jekyll-uj-powertools 1.6.2 → 1.6.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 +4 -4
- data/jekyll-uj-powertools.gemspec +1 -1
- data/lib/tags/iffile.rb +10 -29
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb2525b4822d44d79b90f95dd50e2f4231fc1696825edeaafd13273e42834c4
|
4
|
+
data.tar.gz: eb8b0c45df97fd704a7cda6d2d532606ebf260b10d32edc14588728b3de23684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e08a2ff66c6ba2f03ff2b4e694401c65b09b07a57015b2852e55cae268ab50dd68b2714d7cb5c5b29f755d3a8ab2bca089c63d938587dbdeb94904a3abe2421a
|
7
|
+
data.tar.gz: c2248351129af1c9494262f9ec1d99746f495cc3f124d6b875ab0c1bb765b845d38bf3e16ac35e9e9db119f1f7bc5b22ff407f08b2b8c52ce79103274d49fcfa
|
data/lib/tags/iffile.rb
CHANGED
@@ -13,13 +13,10 @@ module Jekyll
|
|
13
13
|
def render(context)
|
14
14
|
# Get the site object
|
15
15
|
site = context.registers[:site]
|
16
|
-
|
17
|
-
puts "[iffile] Input markup: #{@path}"
|
18
|
-
|
16
|
+
|
19
17
|
# Resolve the path variable if it's a variable name
|
20
18
|
path = context[@path] || @path
|
21
|
-
|
22
|
-
|
19
|
+
|
23
20
|
# Handle nested variables like page.css_path
|
24
21
|
if @path.include?('.')
|
25
22
|
parts = @path.split('.')
|
@@ -28,35 +25,19 @@ module Jekyll
|
|
28
25
|
path = path.is_a?(Hash) ? path[part] : nil
|
29
26
|
break if path.nil?
|
30
27
|
end
|
31
|
-
puts "[iffile] After nested lookup: #{path}"
|
32
28
|
end
|
33
|
-
|
29
|
+
|
34
30
|
# Ensure path starts with /
|
35
31
|
path = "/#{path}" unless path.to_s.start_with?('/')
|
36
|
-
|
37
|
-
|
32
|
+
|
38
33
|
# Check if file exists in static_files
|
39
|
-
|
40
|
-
|
41
|
-
# Debug: show first few static files
|
42
|
-
puts "[iffile] Sample static files (first 5 CSS files):"
|
43
|
-
site.static_files.select { |f| f.relative_path.end_with?('.css') }.first(5).each do |file|
|
44
|
-
puts " - #{file.relative_path}"
|
45
|
-
end
|
46
|
-
|
47
|
-
file_exists = site.static_files.any? { |file|
|
34
|
+
file_exists = site.static_files.any? { |file|
|
48
35
|
# Compare both with and without leading slash
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
if matches
|
53
|
-
puts "[iffile] FOUND MATCH: #{file.relative_path}"
|
54
|
-
end
|
55
|
-
matches
|
36
|
+
file.relative_path == path ||
|
37
|
+
file.relative_path == path[1..-1] ||
|
38
|
+
"/#{file.relative_path}" == path
|
56
39
|
}
|
57
|
-
|
58
|
-
puts "[iffile] File exists: #{file_exists}"
|
59
|
-
|
40
|
+
|
60
41
|
if file_exists
|
61
42
|
super
|
62
43
|
else
|
@@ -67,4 +48,4 @@ module Jekyll
|
|
67
48
|
end
|
68
49
|
end
|
69
50
|
|
70
|
-
Liquid::Template.register_tag('iffile', Jekyll::UJPowertools::IfFileTag)
|
51
|
+
Liquid::Template.register_tag('iffile', Jekyll::UJPowertools::IfFileTag)
|