no-style-please2-plugins 0.9.5.1 → 0.10.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ext.rb +34 -1
  3. data/lib/version/version.rb +1 -1
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cc135b2f61cff8ffff6ec86a2134fe94f3bef78d7cd65f158c851ee81070f1c
4
- data.tar.gz: 64340117ddec7c9c6c8baeb55ad4561673cdc45d7275063e4a4e01954ee13734
3
+ metadata.gz: f82e1c6a05044ef732806e52e77c0fc951f0deb1b90160d6e877e7da2470a14a
4
+ data.tar.gz: f20c7c46f7bc1ddb8faef3b8d8465d35db325c6fae51d283228c5268b95ec731
5
5
  SHA512:
6
- metadata.gz: 681025a200540c33fedfe2e6927d8f97d4ad25b64f92bb58a016a91906ccb04dcfc3e602f91a0708bac0f40543fa559034923e568335c21420b4c9a047840407
7
- data.tar.gz: cc4f57f8967014bda04277e158571780bdec2e4c4e1ae6f41feb23ff6322c5e71d222daf9de04eccd3f10d39443c5aeeb6c6fcb7270a195e3b10deb2b1fa674e
6
+ metadata.gz: d58cd20a98fa8d47b20e7d9a3e924a5c12a7a8eda34fe778efc7b1b56786e2a41856c88d1e2164a8ed0106020310d85113c35182c7de6f3374e98f66a7fdb602
7
+ data.tar.gz: 27aedd26b1c4a59e93da490e58f97a1a58746e41f44b5cc01948909b9044ce897a2e3b234187d304bc8390fdf6b70909844b21434bd423edb7d9b7315de2f1f3
data/lib/ext.rb CHANGED
@@ -157,7 +157,7 @@ module Jekyll
157
157
  filePath = "#{rootPath}/#{text}".strip!()
158
158
  end
159
159
  filePath = File.expand_path(filePath)
160
- puts "--------- inluce code: #{filePath}"
160
+ puts "--------- include code: #{filePath}"
161
161
 
162
162
  begin
163
163
  file = File.open(filePath)
@@ -181,6 +181,36 @@ EOF
181
181
  end
182
182
  end
183
183
 
184
+
185
+ class IncludeRaw < Liquid::Tag
186
+ @filecontent = ""
187
+ def initialize(tag_name, text, tokens)
188
+
189
+ rootPath = $g_config['code_root_path'] || 'static'
190
+ if text.start_with?("/")
191
+ filePath = "#{text}"[1..-1].strip!()
192
+ else
193
+ filePath = "#{rootPath}/#{text}".strip!()
194
+ end
195
+ filePath = File.expand_path(filePath)
196
+ puts "--------- include raw:\n #{filePath}"
197
+
198
+ begin
199
+ file = File.open(filePath)
200
+ @filecontent = file.read()
201
+ rescue => exception
202
+ puts exception
203
+ @filecontent = "load file:#{filePath} failed"
204
+
205
+ end
206
+
207
+ end
208
+
209
+ def render(context)
210
+ return @filecontent
211
+ end
212
+ end
213
+
184
214
 
185
215
 
186
216
 
@@ -188,6 +218,9 @@ EOF
188
218
 
189
219
  Liquid::Template.register_tag('asset_img', Jekyll::AssetImg)
190
220
  Liquid::Template.register_tag('include_code', Jekyll::IncludeCode)
221
+ Liquid::Template.register_tag('include_raw', Jekyll::IncludeRaw)
222
+
223
+
191
224
  Liquid::Template.register_tag('post_link', Jekyll::PostLink)
192
225
  Liquid::Template.register_tag('img_link', Jekyll::ImgLink)
193
226
  Liquid::Template.register_tag('include_file', Jekyll::IncludeFile)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoStylePlease2
4
- VERSION = "0.9.5.1"
4
+ VERSION = "0.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: no-style-please2-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vitock
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-11 00:00:00.000000000 Z
11
+ date: 2025-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -77,7 +77,7 @@ metadata:
77
77
  homepage_uri: https://github.com/vitock/no-style-please2-plugins
78
78
  source_code_uri: https://github.com/vitock/no-style-please2-plugins
79
79
  changelog_uri: https://github.com/vitock/no-style-please2-plugins/blob/main/LICENSE
80
- post_install_message:
80
+ post_install_message:
81
81
  rdoc_options: []
82
82
  require_paths:
83
83
  - lib
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubygems_version: 3.4.1
96
- signing_key:
96
+ signing_key:
97
97
  specification_version: 4
98
98
  summary: plugins for jekyll theme no-style-please2
99
99
  test_files: []