jekyll-simple-icons 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fb2802163d0a420d1ac615ae885278d2c071f72d8a225de89274bfced923c922
4
+ data.tar.gz: 32262585df6a34d065d076832c22960fcb0fa3a2a30b5dd8a17c27373250116c
5
+ SHA512:
6
+ metadata.gz: 7961ba1f2bb30bc398076067d06491c752d38ac8c21d369ef099f54a05b71d542d8a61a00d8d7124e5b6f4d1f73c50ae807b1b256be7c6c2fb52afdd382ddbc1
7
+ data.tar.gz: 67bffdc3b59f8ddb8ff82a13ade958d5028fcc139ae75d7f6cb6b65e9f996a78651368982d2055ce05d212b2e19c543266d8db5c85fdbccd3b7e443e6df07944
data/.editorconfig ADDED
@@ -0,0 +1,24 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = space
8
+ indent_size = 2
9
+ end_of_line = lf
10
+ charset = utf-8
11
+ trim_trailing_whitespace = true
12
+ insert_final_newline = true
13
+
14
+ [*.rb]
15
+ indent_size = 2
16
+
17
+ [*.py]
18
+ indent_size = 4
19
+
20
+ [*.sh]
21
+ indent_size = 4
22
+
23
+ [*.js]
24
+ indent_size = 2
@@ -0,0 +1,31 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ release:
13
+ name: Release
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Create release and upload assets
17
+ uses: softprops/action-gh-release@v2
18
+ with:
19
+ name: ${{ github.ref_name }}
20
+ tag_name: ${{ github.ref_name }}
21
+ body: |
22
+ Release notes for `${{ github.ref_name }}` are available here: https://github.com/pirafrank/jekyll-simple-icons/blob/main/CHANGELOG.md
23
+ generate_release_notes: false
24
+ draft: false
25
+ prerelease: false
26
+ # Note: drafts and prereleases cannot be set as latest.
27
+ make_latest: true
28
+ fail_on_unmatched_files: true
29
+ # no need to specify GITHUB_TOKEN here, it is automatically provided by GitHub Actions
30
+ # https://github.com/softprops/action-gh-release#-customizing
31
+ # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication
data/.gitignore ADDED
@@ -0,0 +1,29 @@
1
+ ### Ruby ###
2
+ *.gem
3
+ *.rbc
4
+ /.config
5
+ /coverage/
6
+ /InstalledFiles
7
+ /pkg/
8
+ /spec/reports/
9
+ /spec/examples.txt
10
+ /test/tmp/
11
+ /test/version_tmp/
12
+ /tmp/
13
+
14
+ ## Documentation cache and generated files:
15
+ /.yardoc/
16
+ /_yardoc/
17
+ /doc/
18
+ /rdoc/
19
+
20
+ ## Environment normalization:
21
+ /.bundle/
22
+ /vendor/bundle
23
+ /lib/bundler/man/
24
+
25
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
26
+ .rvmrc
27
+
28
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
29
+ .rubocop-https?--*
data/.rubocop.yml ADDED
@@ -0,0 +1,25 @@
1
+ require: rubocop-jekyll
2
+
3
+ inherit_gem:
4
+ rubocop-jekyll: .rubocop.yml
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 3.2
8
+ Exclude:
9
+ - vendor/**/*
10
+
11
+ Metrics/LineLength:
12
+ Max: 154
13
+
14
+ Metrics/MethodLength:
15
+ Max: 40
16
+
17
+ Style/StringLiterals:
18
+ EnforcedStyle: double_quotes
19
+
20
+ Style/StringLiteralsInInterpolation:
21
+ EnforcedStyle: double_quotes
22
+
23
+ Style/HashSyntax:
24
+ EnforcedStyle: no_mixed_keys
25
+ EnforcedShorthandSyntax: consistent
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.1.2] - 2025-03-09
6
+
7
+ ### 🚜 Refactor
8
+
9
+ - Turn off rubocop errors
10
+
11
+ ## [0.1.1] - 2025-03-09
12
+
13
+ ### 🚀 Features
14
+
15
+ - First commit
16
+ - Fetch icon data at render time
17
+ this allows you to embed svg data into HTML image tag to avoid additional http requests on your website
18
+
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in jekyll-simple-icons.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,195 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jekyll-simple-icons (0.1.3)
5
+ jekyll (>= 3.7, < 5.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.8.7)
11
+ public_suffix (>= 2.0.2, < 7.0)
12
+ ast (2.4.2)
13
+ base64 (0.2.0)
14
+ bigdecimal (3.1.9)
15
+ colorator (1.1.0)
16
+ concurrent-ruby (1.3.5)
17
+ csv (3.3.2)
18
+ em-websocket (0.5.3)
19
+ eventmachine (>= 0.12.9)
20
+ http_parser.rb (~> 0)
21
+ eventmachine (1.2.7)
22
+ ffi (1.17.1)
23
+ ffi (1.17.1-aarch64-linux-gnu)
24
+ ffi (1.17.1-aarch64-linux-musl)
25
+ ffi (1.17.1-arm-linux-gnu)
26
+ ffi (1.17.1-arm-linux-musl)
27
+ ffi (1.17.1-arm64-darwin)
28
+ ffi (1.17.1-x86-linux-gnu)
29
+ ffi (1.17.1-x86-linux-musl)
30
+ ffi (1.17.1-x86_64-darwin)
31
+ ffi (1.17.1-x86_64-linux-gnu)
32
+ ffi (1.17.1-x86_64-linux-musl)
33
+ forwardable-extended (2.6.0)
34
+ google-protobuf (4.30.0)
35
+ bigdecimal
36
+ rake (>= 13)
37
+ google-protobuf (4.30.0-aarch64-linux)
38
+ bigdecimal
39
+ rake (>= 13)
40
+ google-protobuf (4.30.0-arm64-darwin)
41
+ bigdecimal
42
+ rake (>= 13)
43
+ google-protobuf (4.30.0-x86-linux)
44
+ bigdecimal
45
+ rake (>= 13)
46
+ google-protobuf (4.30.0-x86_64-darwin)
47
+ bigdecimal
48
+ rake (>= 13)
49
+ google-protobuf (4.30.0-x86_64-linux)
50
+ bigdecimal
51
+ rake (>= 13)
52
+ http_parser.rb (0.8.0)
53
+ i18n (1.14.7)
54
+ concurrent-ruby (~> 1.0)
55
+ jekyll (4.4.1)
56
+ addressable (~> 2.4)
57
+ base64 (~> 0.2)
58
+ colorator (~> 1.0)
59
+ csv (~> 3.0)
60
+ em-websocket (~> 0.5)
61
+ i18n (~> 1.0)
62
+ jekyll-sass-converter (>= 2.0, < 4.0)
63
+ jekyll-watch (~> 2.0)
64
+ json (~> 2.6)
65
+ kramdown (~> 2.3, >= 2.3.1)
66
+ kramdown-parser-gfm (~> 1.0)
67
+ liquid (~> 4.0)
68
+ mercenary (~> 0.3, >= 0.3.6)
69
+ pathutil (~> 0.9)
70
+ rouge (>= 3.0, < 5.0)
71
+ safe_yaml (~> 1.0)
72
+ terminal-table (>= 1.8, < 4.0)
73
+ webrick (~> 1.7)
74
+ jekyll-sass-converter (3.1.0)
75
+ sass-embedded (~> 1.75)
76
+ jekyll-watch (2.2.1)
77
+ listen (~> 3.0)
78
+ json (2.10.1)
79
+ kramdown (2.5.1)
80
+ rexml (>= 3.3.9)
81
+ kramdown-parser-gfm (1.1.0)
82
+ kramdown (~> 2.0)
83
+ language_server-protocol (3.17.0.4)
84
+ liquid (4.0.4)
85
+ listen (3.9.0)
86
+ rb-fsevent (~> 0.10, >= 0.10.3)
87
+ rb-inotify (~> 0.9, >= 0.9.10)
88
+ mercenary (0.4.0)
89
+ parallel (1.26.3)
90
+ parser (3.3.7.1)
91
+ ast (~> 2.4.1)
92
+ racc
93
+ pathutil (0.16.2)
94
+ forwardable-extended (~> 2.6)
95
+ public_suffix (6.0.1)
96
+ racc (1.8.1)
97
+ rainbow (3.1.1)
98
+ rake (13.2.1)
99
+ rb-fsevent (0.11.2)
100
+ rb-inotify (0.11.1)
101
+ ffi (~> 1.0)
102
+ regexp_parser (2.10.0)
103
+ rexml (3.4.1)
104
+ rouge (4.5.1)
105
+ rubocop (1.57.2)
106
+ json (~> 2.3)
107
+ language_server-protocol (>= 3.17.0)
108
+ parallel (~> 1.10)
109
+ parser (>= 3.2.2.4)
110
+ rainbow (>= 2.2.2, < 4.0)
111
+ regexp_parser (>= 1.8, < 3.0)
112
+ rexml (>= 3.2.5, < 4.0)
113
+ rubocop-ast (>= 1.28.1, < 2.0)
114
+ ruby-progressbar (~> 1.7)
115
+ unicode-display_width (>= 2.4.0, < 3.0)
116
+ rubocop-ast (1.38.1)
117
+ parser (>= 3.3.1.0)
118
+ rubocop-jekyll (0.14.0)
119
+ rubocop (~> 1.57.0)
120
+ rubocop-performance (~> 1.2)
121
+ rubocop-performance (1.23.1)
122
+ rubocop (>= 1.48.1, < 2.0)
123
+ rubocop-ast (>= 1.31.1, < 2.0)
124
+ ruby-progressbar (1.13.0)
125
+ safe_yaml (1.0.5)
126
+ sass-embedded (1.85.1)
127
+ google-protobuf (~> 4.29)
128
+ rake (>= 13)
129
+ sass-embedded (1.85.1-aarch64-linux-android)
130
+ google-protobuf (~> 4.29)
131
+ sass-embedded (1.85.1-aarch64-linux-gnu)
132
+ google-protobuf (~> 4.29)
133
+ sass-embedded (1.85.1-aarch64-linux-musl)
134
+ google-protobuf (~> 4.29)
135
+ sass-embedded (1.85.1-aarch64-mingw-ucrt)
136
+ google-protobuf (~> 4.29)
137
+ sass-embedded (1.85.1-arm-linux-androideabi)
138
+ google-protobuf (~> 4.29)
139
+ sass-embedded (1.85.1-arm-linux-gnueabihf)
140
+ google-protobuf (~> 4.29)
141
+ sass-embedded (1.85.1-arm-linux-musleabihf)
142
+ google-protobuf (~> 4.29)
143
+ sass-embedded (1.85.1-arm64-darwin)
144
+ google-protobuf (~> 4.29)
145
+ sass-embedded (1.85.1-riscv64-linux-android)
146
+ google-protobuf (~> 4.29)
147
+ sass-embedded (1.85.1-riscv64-linux-gnu)
148
+ google-protobuf (~> 4.29)
149
+ sass-embedded (1.85.1-riscv64-linux-musl)
150
+ google-protobuf (~> 4.29)
151
+ sass-embedded (1.85.1-x86_64-darwin)
152
+ google-protobuf (~> 4.29)
153
+ sass-embedded (1.85.1-x86_64-linux-android)
154
+ google-protobuf (~> 4.29)
155
+ sass-embedded (1.85.1-x86_64-linux-gnu)
156
+ google-protobuf (~> 4.29)
157
+ sass-embedded (1.85.1-x86_64-linux-musl)
158
+ google-protobuf (~> 4.29)
159
+ terminal-table (3.0.2)
160
+ unicode-display_width (>= 1.1.1, < 3)
161
+ unicode-display_width (2.6.0)
162
+ webrick (1.9.1)
163
+
164
+ PLATFORMS
165
+ aarch64-linux
166
+ aarch64-linux-android
167
+ aarch64-linux-gnu
168
+ aarch64-linux-musl
169
+ aarch64-mingw-ucrt
170
+ arm-linux-androideabi
171
+ arm-linux-gnu
172
+ arm-linux-gnueabihf
173
+ arm-linux-musl
174
+ arm-linux-musleabihf
175
+ arm64-darwin
176
+ riscv64-linux-android
177
+ riscv64-linux-gnu
178
+ riscv64-linux-musl
179
+ ruby
180
+ x86-linux
181
+ x86-linux-gnu
182
+ x86-linux-musl
183
+ x86_64-darwin
184
+ x86_64-linux-android
185
+ x86_64-linux-gnu
186
+ x86_64-linux-musl
187
+
188
+ DEPENDENCIES
189
+ bundler (~> 2.6)
190
+ jekyll-simple-icons!
191
+ rake (~> 13.0)
192
+ rubocop-jekyll (~> 0.14)
193
+
194
+ BUNDLED WITH
195
+ 2.6.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Francesco Pira
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # Jekyll Simple Icons
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-simple-icons)](https://rubygems.org/gems/jekyll-simple-icons)
4
+ [![GitHub Release](https://img.shields.io/github/v/release/pirafrank/jekyll-simple-icons)](https://github.com/pirafrank/jekyll-simple-icons/releases/latest)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ A plugin that makes it easy to incorporate [Simple Icons](https://github.com/simple-icons/simple-icons) into your [Jekyll](https://jekyllrb.com/) website, providing access to a vast collection of popular brands icons.
8
+
9
+ ## Features
10
+
11
+ - easy to use: just add `{% simpleicons ICON_NAME %}` to your Jekyll page
12
+ - natively supports any icon from Simple Icons
13
+ - it fetchs icons from the Simple Icons CDN at Jekyll build time for faster page loading of rendered website
14
+ - supports all Simple Icons features, like color, height and width
15
+ - dark mode support to enable automatic color switching when the browser is set so
16
+ - creates an `img` tag with per-icon `alt` attribute for accessibility
17
+
18
+ ## Installation
19
+
20
+ 1. Add the plugin to you Jekyll site's `Gemfile` in the `:jekyll_plugins` group:
21
+
22
+ ```Gemfile
23
+ group :jekyll_plugins do
24
+ gem 'jekyll-simple-icons'
25
+ end
26
+ ```
27
+
28
+ 2. Run `bundle install`
29
+
30
+ 3. Add the following to your website `_config.yml` file:
31
+
32
+ ```yaml
33
+ plugins:
34
+ - jekyll-simple-icons
35
+ ```
36
+
37
+ ### Install from git
38
+
39
+ Alternatively, you can get code straight from this repository. Code from `main` branch should be stable enough but may contain unreleased software with bugs or breaking changes. Unreleased software should be considered of beta quality.
40
+
41
+ ```Gemfile
42
+ group :jekyll_plugins do
43
+ gem 'jekyll-simple-icons', git: 'https://github.com/pirafrank/jekyll-simple-icons', branch: 'main'
44
+ end
45
+ ```
46
+
47
+ ## Update
48
+
49
+ ```sh
50
+ bundle update jekyll-simple-icons
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ Use the tag as follows:
56
+
57
+ ```liquid
58
+ {% simpleicons ICON_NAME %}
59
+ ```
60
+
61
+ where `ICON_NAME` is the name of the icon you want to use.
62
+
63
+ ### Options and Defaults
64
+
65
+ You can optionally specify the `color`, `dark`, `h` (or `height`) and `w` (or `width`) attributes.
66
+
67
+ Defaults to `color:black h:32 w:32` and `dark` not set.
68
+
69
+ When the `dark` attribute is specified, the SVG will include a `@media (prefers-color-scheme:dark)` query with the specified color. This enables automatic color switching when the browser is in dark mode.
70
+
71
+ ### Examples
72
+
73
+ ```liquid
74
+ {% simpleicons github %}
75
+ ```
76
+
77
+ ```liquid
78
+ {% simpleicons github color:purple dark:cyan %}
79
+ ```
80
+
81
+ ```liquid
82
+ {% simpleicons github color:green h:24 w:24 %}
83
+ ```
84
+
85
+ ```liquid
86
+ {% simpleicons github color:gray dark:purple height:48 width:48 %}
87
+ ```
88
+
89
+ ## Development
90
+
91
+ Clone and run `bundle install` to get started.
92
+
93
+ Code lives in `lib/jekyll` directory. `lib/jekyll-simple-icons/simple_icons.rb` is the entry point of the plugin at Jekyll runtime, as per Jekyll documentation. More details [here](https://jekyllrb.com/docs/plugins/tags/).
94
+
95
+ ## Contributing
96
+
97
+ [Bug reports](https://github.com/pirafrank/jekyll-simple-icons/issues) and [pull requests](https://github.com/pirafrank/jekyll-simple-icons/pulls) are welcome on GitHub.
98
+
99
+ ## Code of Conduct
100
+
101
+ Everyone interacting in the project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pirafrank/jekyll-simple-icons/blob/main/CODE_OF_CONDUCT.md).
102
+
103
+ ## Guarantee
104
+
105
+ This plugin is provided as is, without any guarantee.
106
+
107
+ ## License
108
+
109
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). Any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.
110
+
111
+ Simple Icons keeps its own license as it is not part of this codebase.
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task :default do
9
+ sh "rake -AT"
10
+ end
11
+
12
+ task lint: :rubocop
13
+
14
+ task :changelog do
15
+ sh "git cliff --tag #{Gem::Specification.load('jekyll-simple-icons.gemspec').version} -o CHANGELOG.md"
16
+ end
17
+
18
+ task :mkrelease do
19
+ version = Gem::Specification.load("jekyll-simple-icons.gemspec").version
20
+ sh "git cliff --tag #{version} -o CHANGELOG.md"
21
+ sh "git add CHANGELOG.md"
22
+ sh "git commit -m 'chore: update CHANGELOG.md'"
23
+ sh "git tag -s -a -m 'v#{version}' #{version}"
24
+ sh "git push origin #{version}"
25
+ end
26
+
27
+ task :build do
28
+ sh "gem build jekyll-simple-icons.gemspec"
29
+ end
30
+
31
+ task :publish do
32
+ version = Gem::Specification.load("jekyll-simple-icons.gemspec").version
33
+ gem_file = "jekyll-simple-icons-#{version}.gem"
34
+ sh "gem push #{gem_file}"
35
+ end
data/cliff.toml ADDED
@@ -0,0 +1,91 @@
1
+ # git-cliff ~ default configuration file
2
+ # https://git-cliff.org/docs/configuration
3
+ #
4
+ # Lines starting with "#" are comments.
5
+ # Configuration options are organized into tables and keys.
6
+ # See documentation for more information on available options.
7
+
8
+ [changelog]
9
+ # template for the changelog header
10
+ header = """
11
+ # Changelog\n
12
+ All notable changes to this project will be documented in this file.\n
13
+ """
14
+ # template for the changelog body
15
+ # https://keats.github.io/tera/docs/#introduction
16
+ body = """
17
+ {% if version %}\
18
+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19
+ {% else %}\
20
+ ## [unreleased]
21
+ {% endif %}\
22
+ {% for group, commits in commits | group_by(attribute="group") %}
23
+ ### {{ group | striptags | trim | upper_first }}
24
+ {% for commit in commits %}
25
+ - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
26
+ {% if commit.breaking %}[**breaking**] {% endif %}\
27
+ {{ commit.message | upper_first }}\
28
+ {% if commit.body %}\n{% endif %}{{ commit.body | default(value="") | indent(prefix=" ") | trim }}\
29
+ {% if commit.issues %}\
30
+ {% for issue in commit.issues %}\
31
+ ([#{{ issue }}](<REPO>/issues/{{ issue }}))\
32
+ {% endfor %}\
33
+ {% endif %}\
34
+ {% endfor %}
35
+ {% endfor %}\n
36
+ """
37
+ # template for the changelog footer
38
+ #footer = """
39
+ #<!-- generated by git-cliff -->
40
+ #"""
41
+ # remove the leading and trailing s
42
+ trim = true
43
+ # postprocessors
44
+ postprocessors = [
45
+ # { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
46
+ ]
47
+ # render body even when there are no releases to process
48
+ # render_always = true
49
+ # output file path
50
+ # output = "test.md"
51
+
52
+ [git]
53
+ # parse the commits based on https://www.conventionalcommits.org
54
+ conventional_commits = true
55
+ # filter out the commits that are not conventional
56
+ filter_unconventional = true
57
+ # process each line of a commit as an individual commit
58
+ split_commits = false
59
+ # regex for preprocessing the commit messages
60
+ commit_preprocessors = [
61
+ # Replace issue numbers
62
+ #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
63
+ # Check spelling of the commit with https://github.com/crate-ci/typos
64
+ # If the spelling is incorrect, it will be automatically fixed.
65
+ #{ pattern = '.*', replace_command = 'typos --write-changes -' },
66
+ ]
67
+ # regex for parsing and grouping commits
68
+ commit_parsers = [
69
+ { message = "^feat", group = "<!-- 0 -->🚀 Features" },
70
+ { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
71
+ { message = "^doc", group = "<!-- 3 -->📚 Documentation" },
72
+ { message = "^perf", group = "<!-- 4 -->⚡ Performance" },
73
+ { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
74
+ { message = "^improved", group = "<!-- 2 -->🚜 Refactor" },
75
+ { message = "^style", group = "<!-- 5 -->🎨 Styling" },
76
+ { message = "^test", group = "<!-- 6 -->🧪 Testing" },
77
+ { message = "^chore\\(release\\): prepare for", skip = true },
78
+ { message = "^chore\\(deps.*\\)", skip = true },
79
+ { message = "^chore\\(pr\\)", skip = true },
80
+ { message = "^chore\\(pull\\)", skip = true },
81
+ { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
82
+ { body = ".*security", group = "<!-- 8 -->🛡️ Security" },
83
+ { message = "^revert", group = "<!-- 9 -->◀️ Revert" },
84
+ { message = ".*", group = "<!-- 10 -->💼 Other" },
85
+ ]
86
+ # filter out the commits that are not matched by commit parsers
87
+ filter_commits = false
88
+ # sort the tags topologically
89
+ topo_order = false
90
+ # sort the commits inside sections by oldest/newest order
91
+ sort_commits = "oldest"
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/jekyll-simple-icons/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "jekyll-simple-icons"
7
+ spec.version = Jekyll::SimpleIcons::VERSION
8
+ spec.authors = ["Francesco Pira"]
9
+ spec.email = ["dev@fpira.com"]
10
+
11
+ spec.summary = "Jekyll plugin to easily add Simple Icons to your site"
12
+ spec.description = "A plugin that makes it easy to incorporate Simple Icons into your Jekyll website, providing access to a vast collection of popular brands icons."
13
+ spec.homepage = "https://github.com/pirafrank/jekyll-simple-icons"
14
+
15
+ spec.license = "MIT"
16
+ spec.required_ruby_version = ">= 3.2.0"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
23
+
24
+ spec.metadata["homepage_uri"] = spec.homepage
25
+ spec.metadata["changelog_uri"] = "https://github.com/pirafrank/jekyll-simple-icons/blob/main/CHANGELOG.md"
26
+ spec.metadata["bug_tracker_uri"] = "https://github.com/pirafrank/jekyll-simple-icons/issues"
27
+
28
+ spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0"
29
+
30
+ spec.add_development_dependency "bundler", "~> 2.6"
31
+ spec.add_development_dependency "rake", "~> 13.0"
32
+ spec.add_development_dependency "rubocop-jekyll", "~> 0.14"
33
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "base64"
5
+
6
+ module Jekyll
7
+ module SimpleIcons
8
+ class SimpleIconsTag < Liquid::Tag
9
+ def initialize(tag_name, markup, options)
10
+ super
11
+ # Split the markup into icon name and opts
12
+ if markup =~ %r!^([^\s]+)\s*(.+)?$!
13
+ @icon_slug = ::Regexp.last_match(1).strip.downcase
14
+ @opts = {}
15
+ ::Regexp.last_match(2)&.scan(%r!(\w+):\s*([^\s,]+)!) do |key, value|
16
+ @opts[key] = value
17
+ end
18
+ else
19
+ raise SyntaxError, "Syntax Error in 'simpleicons' - Valid syntax: simpleicons icon-name [key:value]"
20
+ end
21
+ end
22
+
23
+ def icon_url
24
+ color = @opts&.fetch("color", "black") || "black" # default to black
25
+ dark_color = @opts&.fetch("dark", nil) || nil # default not to use dark color
26
+
27
+ if dark_color.nil?
28
+ "https://cdn.simpleicons.org/#{@icon_slug}/#{color}"
29
+ else
30
+ "https://cdn.simpleicons.org/#{@icon_slug}/#{color}/#{dark_color}"
31
+ end
32
+ end
33
+
34
+ def download_icon(url)
35
+ uri = URI(url)
36
+ http = Net::HTTP.new(uri.host, uri.port)
37
+ http.use_ssl = uri.scheme == "https"
38
+ http.open_timeout = 5 # 5 seconds timeout for connection
39
+ http.read_timeout = 5 # 5 seconds timeout for reading
40
+
41
+ request = Net::HTTP::Get.new(uri)
42
+ response = http.request(request)
43
+
44
+ if response.code == "200" # net/http returns http status code as string
45
+ response.body
46
+ else
47
+ raise Net::HTTPError.new("Cannot fetch icon from #{url}, got HTTP #{response.code}", response)
48
+ end
49
+ end
50
+
51
+ def svg_to_img_tag(svg_xml, height, width)
52
+ # Strip whitespace and newlines to make the SVG more compact
53
+ svg_xml = svg_xml.gsub(%r!\s+!, " ").strip
54
+ # Encode SVG to Base64
55
+ base64_svg = Base64.strict_encode64(svg_xml)
56
+ # Create the img tag with data URI
57
+ "<img height=\"#{height}\" width=\"#{width}\" src=\"data:image/svg+xml;base64,#{base64_svg}\" alt=\"#{@icon_slug} simple-icon\">"
58
+ end
59
+
60
+ def render(_context) # rubocop:disable Metrics/PerceivedComplexity
61
+ height = @opts&.fetch("h", "32") || @opts&.fetch("height", "32") || "32"
62
+ width = @opts&.fetch("w", "32") || @opts&.fetch("width", "32") || "32"
63
+
64
+ begin
65
+ url = icon_url
66
+ svg_xml = download_icon(url)
67
+ img_tag = svg_to_img_tag(svg_xml, height, width)
68
+ return img_tag.to_s
69
+ rescue SocketError, Net::OpenTimeout, Net::ReadTimeout
70
+ Jekyll.logger.error "[jekyll-simple-icons] Error: Cannot fetch icon from #{url}, connection timeout"
71
+ rescue Net::HTTPError => e
72
+ Jekyll.logger.error "[jekyll-simple-icons] HTTP Error: #{e.message}"
73
+ rescue StandardError => e
74
+ Jekyll.logger.error "[jekyll-simple-icons] Error: #{e.message}"
75
+ end
76
+ ""
77
+ end
78
+ end
79
+ end
80
+ end
81
+
82
+ Liquid::Template.register_tag("simpleicons", Jekyll::SimpleIcons::SimpleIconsTag)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module SimpleIcons
5
+ VERSION = "0.1.3"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "jekyll-simple-icons/version"
4
+ require_relative "jekyll-simple-icons/simple_icons"
5
+
6
+ module Jekyll
7
+ module SimpleIcons
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-simple-icons
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Francesco Pira
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-03-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.7'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.7'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.6'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.6'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '13.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rubocop-jekyll
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.14'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.14'
75
+ description: A plugin that makes it easy to incorporate Simple Icons into your Jekyll
76
+ website, providing access to a vast collection of popular brands icons.
77
+ email:
78
+ - dev@fpira.com
79
+ executables: []
80
+ extensions: []
81
+ extra_rdoc_files: []
82
+ files:
83
+ - ".editorconfig"
84
+ - ".github/workflows/release.yml"
85
+ - ".gitignore"
86
+ - ".rubocop.yml"
87
+ - ".ruby-version"
88
+ - CHANGELOG.md
89
+ - Gemfile
90
+ - Gemfile.lock
91
+ - LICENSE.txt
92
+ - README.md
93
+ - Rakefile
94
+ - cliff.toml
95
+ - jekyll-simple-icons.gemspec
96
+ - lib/jekyll-simple-icons.rb
97
+ - lib/jekyll-simple-icons/simple_icons.rb
98
+ - lib/jekyll-simple-icons/version.rb
99
+ homepage: https://github.com/pirafrank/jekyll-simple-icons
100
+ licenses:
101
+ - MIT
102
+ metadata:
103
+ allowed_push_host: https://rubygems.org
104
+ homepage_uri: https://github.com/pirafrank/jekyll-simple-icons
105
+ changelog_uri: https://github.com/pirafrank/jekyll-simple-icons/blob/main/CHANGELOG.md
106
+ bug_tracker_uri: https://github.com/pirafrank/jekyll-simple-icons/issues
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: 3.2.0
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubygems_version: 3.5.18
123
+ signing_key:
124
+ specification_version: 4
125
+ summary: Jekyll plugin to easily add Simple Icons to your site
126
+ test_files: []