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 +4 -4
- data/README.md +7 -0
- data/jekyll-uj-powertools.gemspec +2 -2
- data/lib/jekyll-uj-powertools/version.rb +1 -1
- data/lib/jekyll-uj-powertools.rb +24 -0
- 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: 2951deca7269ce5d1b66f6522cb9722eeeccf6c513240b8d7e6118c7071c5942
|
4
|
+
data.tar.gz: 36ce46e984684b1a9ea07fe9c1326800a79e98939c3fada5db636cf5e9aa1d13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
24
|
-
spec.test_files
|
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
|
data/lib/jekyll-uj-powertools.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|