jekyll-uj-powertools 1.5.0 → 1.5.1
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/generators/inject-properties.rb +38 -1
- 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: 4e13016489f0630f73c9327a5f2d57732de7fa71aeaf2b62b3a5a74064f09b9e
|
4
|
+
data.tar.gz: 137eb99273904dd784739aa126b46ac3d9aa475f5fc874c332be4fe46169e42b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0516d15e7915a3f9f67f869405244ca59d0032f058fc22e9e63f1b7f9cc7e6466988b327b8bcc254a5f45f9c7787af931f5d5f41df4b232c668e6fadf9ff0ea2
|
7
|
+
data.tar.gz: 66def45c09200d5791aec723cfa0f4a30d49c42de7c1a8a1dd40002412b4ce6a11bd0c7c7b68be5d87d4d813f0880d02514382bc06f70b041e0445ebb4cbebd9
|
@@ -37,6 +37,41 @@ module Jekyll
|
|
37
37
|
hash1.merge(hash2, &merger)
|
38
38
|
end
|
39
39
|
|
40
|
+
def filter_site_config(config)
|
41
|
+
# Get exclusion list from config or use defaults
|
42
|
+
exclusions = config['powertools_resolved_exclude'] || default_exclusions
|
43
|
+
|
44
|
+
# Always exclude the config key itself
|
45
|
+
exclusions_with_config_key = exclusions + ['powertools_resolved_exclude']
|
46
|
+
|
47
|
+
# Create filtered copy
|
48
|
+
filtered = {}
|
49
|
+
config.each do |key, value|
|
50
|
+
next if exclusions_with_config_key.include?(key)
|
51
|
+
filtered[key] = value
|
52
|
+
end
|
53
|
+
|
54
|
+
filtered
|
55
|
+
end
|
56
|
+
|
57
|
+
def default_exclusions
|
58
|
+
# Exclude Jekyll internal keys and potentially large data
|
59
|
+
[
|
60
|
+
# Unnecessary Jekyll keys
|
61
|
+
'plugins', 'gems', 'whitelist', 'plugins_dir',
|
62
|
+
'layouts_dir', 'data_dir', 'includes_dir',
|
63
|
+
'collections', 'jekyll-archives', 'scholar',
|
64
|
+
'assets', 'webpack', 'sass', 'keep_files',
|
65
|
+
'include', 'exclude', 'markdown_ext',
|
66
|
+
|
67
|
+
# Custom exclusions
|
68
|
+
'escapes', 'icons',
|
69
|
+
|
70
|
+
# Use this to customize exclusions in the Jekyll site
|
71
|
+
'powertools_resolved_exclude',
|
72
|
+
]
|
73
|
+
end
|
74
|
+
|
40
75
|
def inject_data(item, site)
|
41
76
|
# Inject a random number into the item's data
|
42
77
|
item.data['random_id'] = rand(100) # Random number between 0 and 99
|
@@ -53,7 +88,9 @@ module Jekyll
|
|
53
88
|
|
54
89
|
# Start with site data
|
55
90
|
if site.config
|
56
|
-
|
91
|
+
# Filter site config to exclude large/unnecessary keys
|
92
|
+
filtered_config = filter_site_config(site.config)
|
93
|
+
resolved = deep_merge(resolved, filtered_config)
|
57
94
|
end
|
58
95
|
|
59
96
|
# Merge layout data if available
|