hyde-page-js 0.3.4 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hyde-page-js.rb +6 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 638071688d5ecd309d300544d9d203a5f64609bda6203381ee0a45ef1d8a0ae2
4
- data.tar.gz: 91fd23bd129212c6c6257033b66d5e3ce2cefdd440f6a92a7faf1657e4b356fb
3
+ metadata.gz: 1168c8847b2fd068219a18afbdae7dabe33a10a3ff32ab72c6aaaf636bb1a6fa
4
+ data.tar.gz: 48245960f5bce1e13fde656141b0d0d0826ad3cea47c777e94bd0a3f138ab707
5
5
  SHA512:
6
- metadata.gz: 99f760e8c290c41b450fe49594369756c7412c69a024f8737e66a549813c9a1f7c59797bd318f2191b837e24af0e42d36d74b90d1f3edf210fb8f343e73f6132
7
- data.tar.gz: 0633dcf9452d791ea464dc4094d7e45c8411dd06ca307bc2d1255bd38259bc7f200ea03777d7ce2957e416ef0510a8469ad1817e98a386ba92279f0066917240
6
+ metadata.gz: fbb7b848ffe41e9cdff801e040550cc4686b3414e21308eb491b25e17d5ef4978d306eb0603211efad9a86011edd4123d38023fa1131fdea81eb091bef5d9484
7
+ data.tar.gz: 9433d3642a63480e82da2e34d8db985349cb249a4cfd6e8577a11037fe26ea8e1545b36fe06342656ed2ffd89e1c4e30cba40e74a0eb1c9eec23b3a7b0b56b1a
data/lib/hyde-page-js.rb CHANGED
@@ -13,7 +13,7 @@ end
13
13
  module Hyde
14
14
  module Page
15
15
  class Js
16
- VERSION = "0.3.4"
16
+ VERSION = "0.4.1"
17
17
  end
18
18
 
19
19
  class GeneratedJsFile < Jekyll::StaticFile
@@ -73,7 +73,9 @@ module Hyde
73
73
  return if js_groups.flatten.empty?
74
74
 
75
75
  for group in js_groups
76
+ next if group.nil?
76
77
  next if group.empty?
78
+
77
79
  lookup_name = names_to_key(group)
78
80
  cache_entry = @site.data['_hyde_pages_cache'].fetch(lookup_name, nil)
79
81
 
@@ -104,7 +106,7 @@ module Hyde
104
106
  end
105
107
 
106
108
  # assign to site.data.js_files for liquid output
107
- add_to_urls(cache_entry&.fetch(:url, nil))
109
+ add_to_urls(cache_entry&.fetch(:url, nil), cache_entry&.fetch(:data, nil))
108
110
  end
109
111
  end
110
112
 
@@ -114,9 +116,9 @@ module Hyde
114
116
  names.join('-')
115
117
  end
116
118
 
117
- def add_to_urls(url)
119
+ def add_to_urls(url, data)
118
120
  @page.data['js_files'] ||= []
119
- @page.data['js_files'].push(url)
121
+ @page.data['js_files'].push({ "path" => url, "content" => data })
120
122
  end
121
123
 
122
124
  def fetch_config
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyde-page-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Daynes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-01 00:00:00.000000000 Z
11
+ date: 2024-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.5.3
74
+ rubygems_version: 3.5.22
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Plugin for jekyll to enable per page js files