jekyll-uj-powertools 1.7.8 → 1.7.11
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 +4 -4
- data/README.md +1 -0
- data/jekyll-uj-powertools.gemspec +1 -1
- data/lib/tags/icon.rb +7 -2
- data/lib/tags/translation_url.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b58316def5bdf1f88a2feb03a14b4c2857e5530eead4f39d246068fbf474cf94
|
|
4
|
+
data.tar.gz: 0ef67cae823576783e197c3557d798420dc341784d3199d7ad8ec8a285f3cf29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e7beb32662dc8dadb479c3f06a17b3c48f930dc09c1bf16a7bf56c826f41fdd1f96ab091b8a849a50aa0706eebeced5b11e91ebe139fd105f517a951eff6d3c
|
|
7
|
+
data.tar.gz: 0b16685b292e37358bfa76721a71778a7b1a629ee6d03a94083aa0db5fae6b48044e89620c48741f2bea17073ccb3e6228b545084e944f908ab509bd391040e4
|
data/README.md
CHANGED
|
@@ -231,6 +231,7 @@ A custom Liquid tag that renders a Font Awesome icon with the specified style an
|
|
|
231
231
|
```liquid
|
|
232
232
|
{% uj_icon "rocket", "fa-lg me-2" %}
|
|
233
233
|
```
|
|
234
|
+
The rendered `<i>` element includes a `data-icon` attribute set to the resolved icon name (e.g. `<i class="fa fa-lg me-2" data-icon="rocket">...</i>`), making it easy to target specific icons in CSS or JS via `[data-icon="rocket"]`.
|
|
234
235
|
|
|
235
236
|
### `uj_logo` Tag
|
|
236
237
|
A custom Liquid tag that renders company logos from the Ultimate Jekyll Manager assets. It supports brandmarks and combomarks in various colors.
|
data/lib/tags/icon.rb
CHANGED
|
@@ -32,6 +32,10 @@ module Jekyll
|
|
|
32
32
|
'he' => 'il', # Hebrew -> Israel
|
|
33
33
|
'th' => 'th', # Thai -> Thailand
|
|
34
34
|
'vi' => 'vn', # Vietnamese -> Vietnam
|
|
35
|
+
'ur' => 'pk', # Urdu -> Pakistan
|
|
36
|
+
'id' => 'id', # Indonesian -> Indonesia
|
|
37
|
+
'bn' => 'bd', # Bengali -> Bangladesh
|
|
38
|
+
'tl' => 'ph', # Tagalog/Filipino -> Philippines
|
|
35
39
|
'uk' => 'ua', # Ukrainian -> Ukraine
|
|
36
40
|
'cs' => 'cz', # Czech -> Czech Republic
|
|
37
41
|
'hu' => 'hu', # Hungarian -> Hungary
|
|
@@ -110,10 +114,11 @@ module Jekyll
|
|
|
110
114
|
# end
|
|
111
115
|
|
|
112
116
|
# Wrap in i tag with CSS classes (always include 'fa' class)
|
|
117
|
+
data_attr = " data-icon=\"#{icon_name}\"" if icon_name && !icon_name.empty?
|
|
113
118
|
if css_classes && !css_classes.empty?
|
|
114
|
-
"<i class=\"fa #{css_classes}\">#{processed_svg}</i>"
|
|
119
|
+
"<i class=\"fa #{css_classes}\"#{data_attr}>#{processed_svg}</i>"
|
|
115
120
|
else
|
|
116
|
-
"<i class=\"fa\">#{processed_svg}</i>"
|
|
121
|
+
"<i class=\"fa\"#{data_attr}>#{processed_svg}</i>"
|
|
117
122
|
end
|
|
118
123
|
end
|
|
119
124
|
|
data/lib/tags/translation_url.rb
CHANGED
|
@@ -37,7 +37,13 @@ module Jekyll
|
|
|
37
37
|
|
|
38
38
|
# Normalize the URL path
|
|
39
39
|
normalized_path = normalize_path(url_path)
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
# If the page is excluded from translation, return the un-prefixed URL
|
|
42
|
+
excludes = translation_config['exclude'] || []
|
|
43
|
+
if page_excluded?(normalized_path, excludes)
|
|
44
|
+
return normalized_path.empty? ? '/' : "/#{normalized_path}"
|
|
45
|
+
end
|
|
46
|
+
|
|
41
47
|
# Generate the language-specific URL
|
|
42
48
|
generate_language_url(language_code, normalized_path, default_language)
|
|
43
49
|
end
|
|
@@ -66,6 +72,14 @@ module Jekyll
|
|
|
66
72
|
clean_path
|
|
67
73
|
end
|
|
68
74
|
|
|
75
|
+
def page_excluded?(normalized_path, excludes)
|
|
76
|
+
return false if excludes.empty? || normalized_path.empty?
|
|
77
|
+
|
|
78
|
+
excludes.any? do |exclude|
|
|
79
|
+
normalized_path == exclude || normalized_path.start_with?("#{exclude}/")
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
69
83
|
def generate_language_url(language_code, normalized_path, default_language)
|
|
70
84
|
# If it's the default language, return the original path
|
|
71
85
|
if language_code == default_language
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-uj-powertools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ITW Creative Works
|
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
226
226
|
- !ruby/object:Gem::Version
|
|
227
227
|
version: '0'
|
|
228
228
|
requirements: []
|
|
229
|
-
rubygems_version: 4.0.
|
|
229
|
+
rubygems_version: 4.0.11
|
|
230
230
|
specification_version: 4
|
|
231
231
|
summary: A powerful set of utilities for Jekyll
|
|
232
232
|
test_files: []
|