jekyll-uj-powertools 1.6.5 → 1.6.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bffbde964f47c8a745b33d13f64b498c5962cc65dfc58d0a7d807d32c1ba346
4
- data.tar.gz: 90cd9e253445a3f971c1dfe3975b9d974f9a1fa33094fa9d3538748d46898d0e
3
+ metadata.gz: a9b9637b2e762641f090f27963e2fe015fd7bb904035881225d5f5488eaab91b
4
+ data.tar.gz: 45ec55354705000d4c812223586a8ade659153a77f4721d6f12105d86cde70e5
5
5
  SHA512:
6
- metadata.gz: 86d48a0f5e1f53ef864fa95b6b1b075620dc42b291e1fb07db8cf54e677fd6e3d3f5641c80f2ebe71be3ae2b15b37dee779fab1cc2dd0db529d0eb77c0d4952f
7
- data.tar.gz: ec6989a1ef5a914641edc2041197ef9a397f37aba45668b64b1d04c7d55b932bb3b8a801679c164785963f6a2cf92c2904e9285524408b4c82a77277c16ea480
6
+ metadata.gz: 5171f17da778cf7b8a336bb7c0dcb1b8dab0662b18dda27e1e6d40c24354a683bb710a3eb874051b364c1d1ee2a5ae49918c43972333b5573ffe14e265eeff45
7
+ data.tar.gz: 07f2dcc88b44fd9a245107df3911287196e87bea2f2142363d125fc03d747e3b14191274924dd3f565f07a408fb161114b6dec836559ee2cf873b47ed1f6f78f
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
  # Gem info
7
7
  spec.name = "jekyll-uj-powertools"
8
- spec.version = "1.6.5"
8
+ spec.version = "1.6.7"
9
9
 
10
10
  # Author info
11
11
  spec.authors = ["ITW Creative Works"]
@@ -16,7 +16,6 @@ module Jekyll
16
16
  require_relative "tags/external"
17
17
  require_relative "tags/fake_comments"
18
18
  require_relative "tags/icon"
19
- require_relative "tags/ifurlmatch"
20
19
  require_relative "tags/iffalsy"
21
20
  require_relative "tags/iffile"
22
21
  require_relative "tags/iftruthy"
@@ -27,4 +26,5 @@ module Jekyll
27
26
  require_relative "tags/readtime"
28
27
  require_relative "tags/social"
29
28
  require_relative "tags/translation_url"
29
+ require_relative "tags/urlmatches"
30
30
  end
@@ -4,9 +4,9 @@ require_relative '../helpers/variable_resolver'
4
4
  # Tag
5
5
  module Jekyll
6
6
  module UJPowertools
7
- class UrlMatchTag < Liquid::Tag
7
+ class UrlMatchesTag < Liquid::Tag
8
8
  include VariableResolver
9
-
9
+
10
10
  def initialize(tag_name, markup, tokens)
11
11
  super
12
12
  # Parse arguments: url, output_if_active
@@ -18,19 +18,19 @@ module Jekyll
18
18
  def render(context)
19
19
  # Get the current page URL
20
20
  page_url = context['page']['url']
21
-
21
+
22
22
  # Resolve the URL to check (handles both literals and variables)
23
23
  check_url = resolve_input(context, @url, true)
24
-
24
+
25
25
  # Resolve the output (handles both literals and variables)
26
26
  output = resolve_input(context, @output, true)
27
-
27
+
28
28
  # Normalize URLs to handle index pages
29
29
  # /about/index.html becomes /about/
30
30
  # / stays as /
31
31
  normalized_page_url = normalize_url(page_url)
32
32
  normalized_check_url = normalize_url(check_url)
33
-
33
+
34
34
  # Return output if URLs match, empty string otherwise
35
35
  if normalized_page_url == normalized_check_url
36
36
  output
@@ -38,24 +38,24 @@ module Jekyll
38
38
  ""
39
39
  end
40
40
  end
41
-
41
+
42
42
  private
43
-
43
+
44
44
  def normalize_url(url)
45
45
  return nil if url.nil?
46
-
46
+
47
47
  # Remove index.html from the end
48
48
  normalized = url.sub(/index\.html?$/, '')
49
-
49
+
50
50
  # Ensure trailing slash for non-root paths
51
51
  if normalized != '/' && !normalized.end_with?('/')
52
52
  normalized += '/'
53
53
  end
54
-
54
+
55
55
  normalized
56
56
  end
57
57
  end
58
58
  end
59
59
  end
60
60
 
61
- Liquid::Template.register_tag('urlmatch', Jekyll::UJPowertools::UrlMatchTag)
61
+ Liquid::Template.register_tag('urlmatches', Jekyll::UJPowertools::UrlMatchesTag)
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.6.5
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works
@@ -132,7 +132,7 @@ files:
132
132
  - lib/tags/readtime.rb
133
133
  - lib/tags/social.rb
134
134
  - lib/tags/translation_url.rb
135
- - lib/tags/urlmatch.rb
135
+ - lib/tags/urlmatches.rb
136
136
  homepage: https://github.com/itw-creative-works/jekyll-uj-powertools
137
137
  licenses:
138
138
  - MIT