al_icons 1.0.0

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: 11203fa93f91bbeb7733e7e91147c545bf967f10e5e05719b793e314ecd89b0e
4
+ data.tar.gz: a07f09b6b6dca1c2f78860700760ab1a21b6a56b97a7a261d62cf026a43752e9
5
+ SHA512:
6
+ metadata.gz: 97bbcc33b007cacee7e7314a3f3f9f156318cb18bfdd28be27e1e8e24e59cd29f2f2752748303673e5b2f57560a5f9fffec5e237c13d702b5e4d48d31f127ef4
7
+ data.tar.gz: 30fe7dbe78471d1bb5308e4549700edde6b5a58a1417137bd046402c4b192f09dc04fd1a44df9617d7c9ae4ad78a452610283629561da9314bcfbbeac4b5759c
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Initial extraction of icon runtime ownership from `al_folio_core`.
6
+ - Added `al_icons_styles` Liquid tag for Font Awesome, Academicons, and Scholar Icons.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) al-org
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # al-icons
2
+
3
+ `al-icons` owns icon runtime assets for al-folio v1.x.
4
+
5
+ ## Responsibilities
6
+
7
+ - Render icon stylesheet tags via `{% al_icons_styles %}`
8
+ - Centralize pinned icon CDN URLs and optional SRI usage
9
+ - Keep icon ownership out of `al_folio_core` and starter runtime files
10
+
11
+ ## Usage
12
+
13
+ Add plugin to `_config.yml`:
14
+
15
+ ```yml
16
+ plugins:
17
+ - al_icons
18
+ ```
19
+
20
+ Add parse-safe include wrapper in theme/head templates:
21
+
22
+ ```liquid
23
+ {% include plugins/al_icons_styles.liquid %}
24
+ ```
25
+
26
+ Expected config:
27
+
28
+ ```yml
29
+ third_party_libraries:
30
+ fontawesome:
31
+ url:
32
+ css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.2.0/css/all.min.css
33
+ integrity:
34
+ css: ...
35
+ academicons:
36
+ url:
37
+ css: https://cdn.jsdelivr.net/npm/academicons@1.9.5/css/academicons.min.css
38
+ integrity:
39
+ css: ...
40
+ scholar-icons:
41
+ url:
42
+ css: https://cdn.jsdelivr.net/npm/scholar-icons@1.0.3/css/scholar-icons.css
43
+ integrity:
44
+ css: ...
45
+ ```
46
+
47
+ `integrity.css` is optional per library; when omitted, the tag renders without integrity/crossorigin attributes.
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AlIcons
4
+ VERSION = '1.0.0'
5
+ end
data/lib/al_icons.rb ADDED
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jekyll'
4
+ require 'liquid'
5
+ require_relative 'al_icons/version'
6
+
7
+ module AlIcons
8
+ LIBRARIES = {
9
+ 'fontawesome' => ['fontawesome', 'Font Awesome'],
10
+ 'academicons' => ['academicons', 'Academicons'],
11
+ 'scholar-icons' => ['scholar-icons', 'Scholar Icons']
12
+ }.freeze
13
+
14
+ class IconStylesTag < Liquid::Tag
15
+ def render(context)
16
+ site = context.registers[:site]
17
+ return '' unless site
18
+
19
+ libs = site.config['third_party_libraries'] || {}
20
+
21
+ rendered = LIBRARIES.map do |config_key, display_name|
22
+ key, label = display_name
23
+ cfg = libs[key] || libs[config_key]
24
+ next '' unless cfg.is_a?(Hash)
25
+
26
+ href = cfg.dig('url', 'css')
27
+ next '' unless href.to_s.strip != ''
28
+
29
+ integrity = cfg.dig('integrity', 'css')
30
+ if integrity.to_s.strip != ''
31
+ <<~HTML
32
+ <!-- #{label} -->
33
+ <link defer rel="stylesheet" href="#{href}" integrity="#{integrity}" crossorigin="anonymous">
34
+ HTML
35
+ else
36
+ <<~HTML
37
+ <!-- #{label} -->
38
+ <link defer rel="stylesheet" href="#{href}">
39
+ HTML
40
+ end
41
+ end
42
+
43
+ rendered.reject(&:empty?).join("\n")
44
+ end
45
+ end
46
+ end
47
+
48
+ Liquid::Template.register_tag('al_icons_styles', AlIcons::IconStylesTag)
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: al_icons
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - al-org
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: jekyll
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '3.9'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '5.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '3.9'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '5.0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: liquid
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '4.0'
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: '6.0'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '4.0'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '6.0'
52
+ - !ruby/object:Gem::Dependency
53
+ name: bundler
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '2.0'
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: '3.0'
72
+ - !ruby/object:Gem::Dependency
73
+ name: rake
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - "~>"
77
+ - !ruby/object:Gem::Version
78
+ version: '13.0'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '13.0'
86
+ description: Jekyll plugin extracted from al-folio that renders Font Awesome, Academicons,
87
+ and Scholar Icons assets through Liquid tags.
88
+ email:
89
+ - dev@al-org.dev
90
+ executables: []
91
+ extensions: []
92
+ extra_rdoc_files: []
93
+ files:
94
+ - CHANGELOG.md
95
+ - LICENSE
96
+ - README.md
97
+ - lib/al_icons.rb
98
+ - lib/al_icons/version.rb
99
+ homepage: https://github.com/al-org-dev/al-icons
100
+ licenses:
101
+ - MIT
102
+ metadata:
103
+ allowed_push_host: https://rubygems.org
104
+ homepage_uri: https://github.com/al-org-dev/al-icons
105
+ source_code_uri: https://github.com/al-org-dev/al-icons
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '2.7'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubygems_version: 4.0.6
121
+ specification_version: 4
122
+ summary: Icon runtime tag plugin for al-folio
123
+ test_files: []