jekyll-uj-powertools 1.0.12 → 1.0.14

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: 147ad3076693c523b71857007198ee3eada3a42e6c5a901e260cc46f84551412
4
- data.tar.gz: fbdcc88a6f2ef3c76f57cf630e6a35dc179bbbb30a4a4e10c0726af15baa5f95
3
+ metadata.gz: 2951deca7269ce5d1b66f6522cb9722eeeccf6c513240b8d7e6118c7071c5942
4
+ data.tar.gz: 36ce46e984684b1a9ea07fe9c1326800a79e98939c3fada5db636cf5e9aa1d13
5
5
  SHA512:
6
- metadata.gz: ead4a46fb7fbf6fe7f2943b8578293120c119566c6f9054c9e02cf9fb7148e15214e0440a2618f17a0dcf347549be119165cf66b7b4c068f997518b572cb2763
7
- data.tar.gz: e5ea71be564a184b92d32148a2b4dd5a99f3b1e04b5e667da2c7246e076e0372c180be39b82cc8071915b1bded36143eb8c7f1dc8401df236187495ac0b014ff
6
+ metadata.gz: 1abd2f912c44772ff584c26b391a96b747dbe7877330bdbb6629c85868885c7480ccb6aeb4ebf9e0eb1119e228b1e444ac4406c3afc31aabd1570558616c610c
7
+ data.tar.gz: 86f17d73cb56e7417ca49afc7129d8a57bcbea354dca1e87eaccb5c690b68c502eebe7e2b53202887d32cfd9f4348d007ac0ed1011427d728699229c45491fdf
data/README.md CHANGED
@@ -62,6 +62,13 @@ Escape JSON characters in a string making it safe to use in a JSON object.
62
62
  {{ post.content | uj_json_escape }}
63
63
  ```
64
64
 
65
+ ### `uj_title_case` Filter
66
+ Convert a string to title case.
67
+
68
+ ```liquid
69
+ {{ "hello world" | uj_title_case }}
70
+ ```
71
+
65
72
  These examples show how you can use the features of `jekyll-uj-powertools` in your Jekyll site.
66
73
 
67
74
  ## 🔧 Development
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  # Files
22
22
  spec.files = Dir["CODE_OF_CONDUCT.md", "README*.md", "LICENSE", "Rakefile", "*.gemspec", "Gemfile", "lib/**/*", "spec/**/*"]
23
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  # Gem requires Jekyll to work
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module UJPowertools
3
- VERSION = "1.0.12"
3
+ VERSION = "1.0.14"
4
4
  end
5
5
  end
@@ -48,6 +48,30 @@ module Jekyll
48
48
  input.split(' ').map(&:capitalize).join(' ')
49
49
  end
50
50
  end
51
+
52
+ class InjectData < Generator
53
+ safe true
54
+ priority :low
55
+
56
+ def generate(site)
57
+ # Loop through all pages
58
+ site.pages.each do |page|
59
+ # Inject a random number into the page's data
60
+ page.data['random_number'] = rand(100) # Random number between 0 and 99
61
+
62
+ next unless page.data['layout'] # Skip pages without layouts
63
+
64
+ # Find the layout file by its name
65
+ layout_name = page.data['layout']
66
+ layout = site.layouts[layout_name]
67
+
68
+ if layout && layout.data
69
+ # Merge layout front matter into page's "layout_data"
70
+ page.data['layout_data'] = layout.data
71
+ end
72
+ end
73
+ end
74
+ end
51
75
  end
52
76
 
53
77
  Liquid::Template.register_filter(Jekyll::UJPowertools)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-uj-powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll