jekyll_plugin_support 3.1.2 → 3.1.5
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/CHANGELOG.md +23 -39
- data/README.md +37 -6
- data/lib/block/jekyll_plugin_support_block.rb +9 -5
- data/lib/helper/jekyll_plugin_helper_class.rb +6 -8
- data/lib/jekyll_plugin_support/jekyll_plugin_support_class.rb +44 -8
- data/lib/jekyll_plugin_support/version.rb +1 -1
- data/lib/tag/jekyll_plugin_support_tag.rb +9 -5
- data/spec/status_persistence.txt +48 -47
- 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: 8d4f6b9106ad6c0ac015ac96af510e4f284d01de3296b29f815cfe74a14dd249
|
|
4
|
+
data.tar.gz: aa2ff95dfa6366d6c1b06e6fe7689d34131bf699e17a8ce05090fe1df836ceb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 629abbd99fb59ca3c741d623bc34248377c65744209a2f2b06b27b030aaaa8fba616e92db61494474ac2810674deb49aafd5ef006761e2fcc05380ecf733de80
|
|
7
|
+
data.tar.gz: bc8b36722bf0a033231a7b60f1cc70de4c354b898c4ab45ea99aaabe6a8cb70886550fb4bde13524ac741a789824178c76bfdfcd3dcd33cb79d854cfe87a6025
|
data/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.1.5
|
|
4
|
+
|
|
5
|
+
* Added install subcommand to bundle invocations
|
|
6
|
+
* Replaced wslvar which is no longer maintained
|
|
7
|
+
|
|
8
|
+
## 3.1.4
|
|
9
|
+
|
|
10
|
+
* Added `@jekyll_version` instance variable exposing raw HTML content of the page being processed
|
|
11
|
+
* Added `@raw_content` instance variable exposing raw HTML content of the page being processed
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## 3.1.3 / 2025-01-02
|
|
4
15
|
|
|
5
|
-
*
|
|
6
|
-
variables (`$VAR` or `${VAR}`), not Windows environment variables (`%VAR%`)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
need Windows environment variable expansion.
|
|
12
|
-
* `jekyll_flexible_include_plugin` now explicitly calls both `env_var_expand_bash` and
|
|
13
|
-
`env_var_expand_windows` for file paths to maintain its ability to handle both Bash and
|
|
14
|
-
Windows environment variables.
|
|
15
|
-
* Updated `JekyllPluginHelper.find_windows_envar` to properly fall back to environment variable
|
|
16
|
-
search when `wslvar` is not available or doesn't find the variable.
|
|
16
|
+
* Modified `JekyllPluginHelper.expand_env` to only expand Bash environment
|
|
17
|
+
variables (`$VAR` or `${VAR}`), not Windows environment variables (`%VAR%`)
|
|
18
|
+
* Removed the `use_wslvar` parameter from `JekyllPluginHelper.expand_env` method
|
|
19
|
+
signature
|
|
20
|
+
* `env_var_expand_windows` remains available for plugins that specifically need
|
|
21
|
+
Windows environment variable expansion
|
|
17
22
|
|
|
18
23
|
|
|
19
24
|
## 3.1.2 / 2025-11-17
|
|
@@ -69,12 +74,7 @@
|
|
|
69
74
|
* Added the `bin/release_port` script that kills hung processes being debugged
|
|
70
75
|
* Added the `cleanDemo` task for the **Debug Demo production** and **Debug Demo development** tasks
|
|
71
76
|
* Many minor improvements to the demo.
|
|
72
|
-
* `
|
|
73
|
-
Use it like this:
|
|
74
|
-
|
|
75
|
-
```ruby
|
|
76
|
-
JekyllPluginHelper.register(self, 'tag_name', quiet: true)
|
|
77
|
-
```
|
|
77
|
+
* `JekyllPluginHelper.register` now accepts a `quiet` option to suppress the signon message
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
## 1.0.3 / 2024-08-19
|
|
@@ -86,19 +86,7 @@
|
|
|
86
86
|
|
|
87
87
|
* Computes line_number and path properly
|
|
88
88
|
* Refactored demo CSS
|
|
89
|
-
* Improved custom plugin error handling and sample code
|
|
90
|
-
The following seems to be optimal for custom plugins; it suppresses the ridiculously long stack trace that used to be generated:
|
|
91
|
-
|
|
92
|
-
```ruby
|
|
93
|
-
begin
|
|
94
|
-
# ...
|
|
95
|
-
rescue DemoInlineTagError => e # jekyll_plugin_support handles StandardError
|
|
96
|
-
@logger.error { e.logger_message }
|
|
97
|
-
exit! 1 if @die_on_demo_tag_error
|
|
98
|
-
|
|
99
|
-
e.html_message
|
|
100
|
-
end
|
|
101
|
-
```
|
|
89
|
+
* Improved custom plugin error handling and sample code
|
|
102
90
|
|
|
103
91
|
|
|
104
92
|
## 1.0.1 / 2024-07-27
|
|
@@ -161,10 +149,8 @@
|
|
|
161
149
|
* Demo site now shows how to define and handle custom errors.
|
|
162
150
|
* Added `@tag_config` variable, which can be inspected to determine whether to die on various types of exceptions.
|
|
163
151
|
* Added `format_error_message`, `maybe_reraise_error`, and `raise_error` to `JekyllBlock` and `JekyllTag`
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
See the `demo/` directory for examples of how to use this optional feature.
|
|
167
|
-
* The `plugin-vars` section in `_config.yml` was renamed to `liquid_vars`.
|
|
152
|
+
* Added `shorten_backtrace` to StandardError and all custom error classes defined by `JekyllSupport.define_error`
|
|
153
|
+
* The `plugin-vars` section in `_config.yml` was renamed to `liquid_vars`
|
|
168
154
|
|
|
169
155
|
|
|
170
156
|
## 0.7.2 / 2023-08-14
|
|
@@ -176,10 +162,8 @@
|
|
|
176
162
|
|
|
177
163
|
* Suppressed stack trace from issue [#4](../../issues/4).
|
|
178
164
|
* Now using Shopify `ruby-lsp` instead of `rebornix.Ruby` by Peng Lv
|
|
179
|
-
* Debug configurations changed to `rdbg` instead of `ruby`, so the `debase` development dependency was changed to
|
|
180
|
-
|
|
181
|
-
which provides the `rdgb` command.
|
|
182
|
-
The `ruby-debug-ide` development dependency is also no longer required.
|
|
165
|
+
* Debug configurations changed to `rdbg` instead of `ruby`, so the `debase` development dependency was changed to [`debug`](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg)
|
|
166
|
+
* The `ruby-debug-ide` development dependency is no longer required
|
|
183
167
|
|
|
184
168
|
|
|
185
169
|
## 0.7.0 / 2023-05-22
|
data/README.md
CHANGED
|
@@ -35,6 +35,9 @@ Public plugins that use `jekyll_plugin_support` include:
|
|
|
35
35
|
<li>
|
|
36
36
|
<a href='https://www.mslinn.com/jekyll_plugins/jekyll_img.html'><code>jekyll_img</code></a>
|
|
37
37
|
</li>
|
|
38
|
+
<li>
|
|
39
|
+
<a href='https://www.mslinn.com/jekyll_plugins/jekyll_kramdown.html'><code>jekyll_kramdown</code></a>
|
|
40
|
+
</li>
|
|
38
41
|
<li>
|
|
39
42
|
<a href='https://www.mslinn.com/jekyll_plugins/jekyll_outline.html'><code>jekyll_outline</code></a>
|
|
40
43
|
</li>
|
|
@@ -54,7 +57,8 @@ Public plugins that use `jekyll_plugin_support` include:
|
|
|
54
57
|
|
|
55
58
|
Jekyll plugin tags created from `jekyll_plugin_support` framework automatically have the following features:
|
|
56
59
|
|
|
57
|
-
0.
|
|
60
|
+
0. Generic LLM support is provided; tested and works with Claude and mini-agent from MiniMax.
|
|
61
|
+
Gemini is not recommended since it can only handle one project at a time, and this component is a project.
|
|
58
62
|
1. Boilerplate is removed, so you can focus on the required logic and output.
|
|
59
63
|
2. Arguments are parsed for keywords and name/value parameters.
|
|
60
64
|
3. Single or double quotes can be used for arguments and parameters.
|
|
@@ -154,7 +158,7 @@ end
|
|
|
154
158
|
Install the `jekyll_plugin_support` gem into your plugin project in the usual manner:
|
|
155
159
|
|
|
156
160
|
```shell
|
|
157
|
-
$ bundle
|
|
161
|
+
$ bundle install
|
|
158
162
|
```
|
|
159
163
|
|
|
160
164
|
Copy the CSS classes from
|
|
@@ -456,9 +460,21 @@ Included spaces are ignored:
|
|
|
456
460
|
* [`@config`](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#configuring-jekyll-in-your-github-pages-site)
|
|
457
461
|
The [YAML](https://yaml.org/) Jekyll site configuration file
|
|
458
462
|
|
|
463
|
+
- `@jekyll_version` version of Jekyll, the returned string might have a value like "4.4.1".
|
|
464
|
+
|
|
459
465
|
* [`@helper`](https://github.com/mslinn/jekyll_plugin_support/blob/master/lib/jekyll_plugin_helper.rb)
|
|
460
466
|
`JekyllPluginHelper` instance for your plugin.
|
|
461
467
|
|
|
468
|
+
* `@highlighter_prefix` Syntax highlighter prefix, as it exists
|
|
469
|
+
during the [layout rendering stage](https://jekyllrb.com/docs/plugins/hooks/)
|
|
470
|
+
occurring between `:documents, :post_convert` and `:documents, :post_render`.
|
|
471
|
+
All pages, posts and documents go through this phase.
|
|
472
|
+
|
|
473
|
+
* `@highlighter_suffix` Syntax highlighter suffix, as it exists
|
|
474
|
+
during the [layout rendering stage](https://jekyllrb.com/docs/plugins/hooks/)
|
|
475
|
+
occurring between `:documents, :post_convert` and `:documents, :post_render`.
|
|
476
|
+
All pages, posts and documents go through this phase.
|
|
477
|
+
|
|
462
478
|
* [`@layout`](https://jekyllrb.com/docs/variables/#global-variables) Layout information
|
|
463
479
|
|
|
464
480
|
* `@logger` [`jekyll_plugin_logger`](https://github.com/mslinn/jekyll_plugin_logger) instance for your Jekyll plugin.
|
|
@@ -470,6 +486,11 @@ Included spaces are ignored:
|
|
|
470
486
|
|
|
471
487
|
* [`@paginator`](https://jekyllrb.com/docs/variables/#page-variables) Pagination variables
|
|
472
488
|
|
|
489
|
+
- `@raw_content` The raw HTML/Markdown content of the current page, as it exists
|
|
490
|
+
during the [layout rendering stage](https://jekyllrb.com/docs/plugins/hooks/)
|
|
491
|
+
occurring between `:documents, :post_convert` and `:documents, :post_render`.
|
|
492
|
+
All pages, posts and documents go through this phase.
|
|
493
|
+
|
|
473
494
|
* [`@scopes`](https://jekyllrb.com/docs/variables/)
|
|
474
495
|
See the [`jekyll_plugin_support` demo project](demo/variables.html)
|
|
475
496
|
|
|
@@ -643,16 +664,20 @@ They are can be used like any other Liquid variable.
|
|
|
643
664
|
## Variable Expansion
|
|
644
665
|
|
|
645
666
|
Jekyll expands Liquid variable references during the page rendering process.
|
|
646
|
-
Jekyll does not expand Liquid variable references
|
|
667
|
+
Jekyll does not expand Liquid variable references passed as parameters to tag and block plugins, however.
|
|
647
668
|
However, plugins made from `jekyll_plugin_support` automatically
|
|
648
669
|
expand all types of variable references passed as parameters and in block tag bodies.
|
|
649
670
|
|
|
650
|
-
`
|
|
671
|
+
`jekyll_plugin_support` tag and block plugins expand the following types of variables:
|
|
651
672
|
|
|
652
|
-
*
|
|
673
|
+
* jekyll_plugin_support configuration variables, discussed above.
|
|
653
674
|
* Jekyll [page](https://jekyllrb.com/docs/variables/#page-variables) and
|
|
654
675
|
[layout](https://jekyllrb.com/docs/layouts/#variables) variables.
|
|
676
|
+
* Jekyll global variables such as `jekyll.version` and `jekyll.environment`.
|
|
655
677
|
* Inline Liquid variables (defined in [assign](https://shopify.dev/docs/api/liquid/tags/assign) and [capture](https://shopify.dev/docs/api/liquid/tags/capture) statements).
|
|
678
|
+
* Include variables (when plugins are invoked from within Jekyll include files with parameters).
|
|
679
|
+
* Theme variables (provided by the active theme).
|
|
680
|
+
* Paginator variables (for sites with pagination).
|
|
656
681
|
|
|
657
682
|
In the following example web page, Jekyll expands the `var1` reference within the `<p></p>` tag,
|
|
658
683
|
but not the `var1` or `var2` references passed to `my_plugin`.
|
|
@@ -674,8 +699,14 @@ Thus, the above is interpreted as follows when `my_plugin` is evaluated during t
|
|
|
674
699
|
{% my_plugin param1="value1" param2="value 2" %}
|
|
675
700
|
```
|
|
676
701
|
|
|
702
|
+
**Note on Variable Resolution Order**: Variables are processed in Jekyll's actual priority order to ensure expected behavior:
|
|
703
|
+
1. Page variables (e.g., `{{page.title}}`)
|
|
704
|
+
2. Layout variables (e.g., `{{layout.name}}`)
|
|
705
|
+
3. Jekyll global variables (e.g., `{{jekyll.version}}`)
|
|
706
|
+
4. Include variables (e.g., `{{include.my_var}}`)
|
|
707
|
+
5. Liquid variables (e.g., `{{my_var}}` from `assign`/`capture`)
|
|
677
708
|
|
|
678
|
-
`
|
|
709
|
+
`jekyll_plugin_support` expands most of the [plugin variables described above](#predefined-variables),
|
|
679
710
|
replacing Liquid variable references with their values.
|
|
680
711
|
The exception is `@argument_string`, which is not expanded.
|
|
681
712
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module JekyllSupport
|
|
2
2
|
# Base class for Jekyll block tags
|
|
3
3
|
class JekyllBlock < Liquid::Block
|
|
4
|
-
attr_reader :argument_string, :helper, :line_number, :logger, :page, :site, :text
|
|
4
|
+
attr_reader :argument_string, :helper, :highlighter_prefix, :highlighter_suffix, :jekyll_version, :line_number, :logger, :page, :raw_content, :site, :text
|
|
5
5
|
|
|
6
6
|
# See https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers#create-your-own-tags
|
|
7
7
|
# @param tag_name [String] the name of the tag, which we usually know.
|
|
@@ -62,9 +62,13 @@ module JekyllSupport
|
|
|
62
62
|
set_error_context
|
|
63
63
|
|
|
64
64
|
# @envs.keys are :content, :highlighter_prefix, :highlighter_suffix, :jekyll, :layout, :page, :paginator, :site, :theme
|
|
65
|
-
@
|
|
66
|
-
@
|
|
67
|
-
@
|
|
65
|
+
@highlighter_prefix = @envs[:highlighter_prefix]
|
|
66
|
+
@highlighter_suffix = @envs[:highlighter_suffix]
|
|
67
|
+
@jekyll_version = @envs[:jekyll]['version']
|
|
68
|
+
@layout = @envs[:layout]
|
|
69
|
+
@paginator = @envs[:paginator]
|
|
70
|
+
@raw_content = @envs[:content]
|
|
71
|
+
@theme = @envs[:theme]
|
|
68
72
|
|
|
69
73
|
env = @config['env']
|
|
70
74
|
@mode = env&.key?('JEKYLL_ENV') ? env['JEKYLL_ENV'] : 'development'
|
|
@@ -100,7 +104,7 @@ module JekyllSupport
|
|
|
100
104
|
# Jekyll plugins should override this method, not render,
|
|
101
105
|
# so they can be tested more easily.
|
|
102
106
|
# The following variables are predefined:
|
|
103
|
-
# @argument_string, @config, @envs, @helper, @layout, @logger, @mode, @page, @paginator, @site, @tag_name and @theme
|
|
107
|
+
# @argument_string, @config, @envs, @helper, @highlighter_prefix, @highlighter_suffix, @layout, @logger, @mode, @page, @paginator, @raw_content, @site, @tag_name and @theme
|
|
104
108
|
# @return [String] The result to be rendered to the invoking page
|
|
105
109
|
def render_impl(text)
|
|
106
110
|
text
|
|
@@ -68,15 +68,9 @@ module JekyllSupport
|
|
|
68
68
|
#
|
|
69
69
|
def self.find_windows_envar(envar, use_wslvar: true)
|
|
70
70
|
if use_wslvar
|
|
71
|
-
|
|
72
|
-
if wslvar_path.empty?
|
|
73
|
-
warn "jekyll_plugin_support warning: wslvar not found in PATH; will attempt to find $#{envar} in the bash environment variables."
|
|
74
|
-
return env_var_case_insensitive(envar)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
result = `wslvar #{envar} &2> /dev/null`.chomp
|
|
71
|
+
result = self.wslvar envar
|
|
78
72
|
if result.empty?
|
|
79
|
-
|
|
73
|
+
error "jekyll_plugin_support warning: wslvar did not find $#{envar}; will attempt to find it in the bash environment variables."
|
|
80
74
|
return env_var_case_insensitive(envar)
|
|
81
75
|
end
|
|
82
76
|
|
|
@@ -85,6 +79,10 @@ module JekyllSupport
|
|
|
85
79
|
env_var_case_insensitive(envar)
|
|
86
80
|
end
|
|
87
81
|
|
|
82
|
+
def self.wslvar(envar)
|
|
83
|
+
result = `powershell.exe -NoProfile -Command "Write-Output \\$env:#{envar}" 2> /dev/null`.chomp("\r\n")
|
|
84
|
+
end
|
|
85
|
+
|
|
88
86
|
# Detect if Jekyll is running under WSL
|
|
89
87
|
def self.wsl_detected? = File.read('/proc/version').include?('-WSL')
|
|
90
88
|
|
|
@@ -51,17 +51,22 @@ module JekyllSupport
|
|
|
51
51
|
|
|
52
52
|
scope = liquid_context.scopes.last
|
|
53
53
|
|
|
54
|
+
# Support multiple environment variable keys and fall back to Jekyll's environment
|
|
54
55
|
env = site.config['env']
|
|
55
|
-
@mode = env&.
|
|
56
|
+
@mode = env&.[]('JEKYLL_ENV') ||
|
|
57
|
+
env&.[]('JEKYLL_ENVIRONMENT') ||
|
|
58
|
+
site.config['JEKYLL_ENV'] ||
|
|
59
|
+
site.config['JEKYLL_ENVIRONMENT'] ||
|
|
60
|
+
'development'
|
|
56
61
|
|
|
57
|
-
# Set default values
|
|
62
|
+
# Set default values (support multiple data types)
|
|
58
63
|
plugin_variables&.each do |name, value|
|
|
59
|
-
scope[name] = value
|
|
64
|
+
scope[name] = value
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
# Override with environment-specific values
|
|
63
68
|
plugin_variables&.[](@mode)&.each do |name, value|
|
|
64
|
-
scope[name] = value
|
|
69
|
+
scope[name] = value
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
liquid_context
|
|
@@ -87,9 +92,17 @@ module JekyllSupport
|
|
|
87
92
|
page = liquid_context.registers[:page]
|
|
88
93
|
envs = liquid_context.environments.first
|
|
89
94
|
layout = envs[:layout]
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
jekyll = envs[:jekyll]
|
|
96
|
+
|
|
97
|
+
# Process variables in Jekyll's actual priority order:
|
|
98
|
+
# 1. Page variables (registers[:page])
|
|
99
|
+
# 2. Layout variables (environments.first[:layout])
|
|
100
|
+
# 3. Jekyll global variables (environments.first[:jekyll])
|
|
101
|
+
# 4. Include variables (scopes)
|
|
102
|
+
# 5. Liquid variables (scopes)
|
|
92
103
|
markup = process_page_variables logger, page, markup
|
|
104
|
+
markup = process_layout_variables logger, layout, markup
|
|
105
|
+
markup = process_jekyll_variables logger, jekyll, markup
|
|
93
106
|
liquid_context.scopes&.each do |scope|
|
|
94
107
|
markup = process_included_variables logger, scope, markup
|
|
95
108
|
markup = process_liquid_variables logger, scope, markup
|
|
@@ -105,12 +118,13 @@ module JekyllSupport
|
|
|
105
118
|
raise JekyllPluginSupportError, "include.#{name} is a #{name.class}, not a String." unless name.instance_of?(String)
|
|
106
119
|
raise JekyllPluginSupportError, "include.#{name} has an undefined value." if value.nil?
|
|
107
120
|
|
|
108
|
-
|
|
121
|
+
# Sanitize variable name to prevent regex injection
|
|
122
|
+
sanitized_name = sanitize_variable_name(name)
|
|
123
|
+
markup.gsub!("{{include.#{sanitized_name}}}", value.to_s)
|
|
109
124
|
end
|
|
110
125
|
markup
|
|
111
126
|
rescue StandardError => e
|
|
112
127
|
logger.error { e.full_message }
|
|
113
|
-
exit! 1
|
|
114
128
|
end
|
|
115
129
|
|
|
116
130
|
def self.process_layout_variables(logger, layout, markup)
|
|
@@ -154,6 +168,28 @@ module JekyllSupport
|
|
|
154
168
|
logger.error { e.full_message }
|
|
155
169
|
end
|
|
156
170
|
|
|
171
|
+
def self.process_jekyll_variables(logger, jekyll, markup)
|
|
172
|
+
return markup unless jekyll
|
|
173
|
+
|
|
174
|
+
# JekyllDrop provides access to version and environment
|
|
175
|
+
# Handle known JekyllDrop attributes
|
|
176
|
+
markup.gsub!('{{jekyll.version}}', jekyll.version.to_s) if jekyll.respond_to?(:version)
|
|
177
|
+
|
|
178
|
+
markup.gsub!('{{jekyll.environment}}', jekyll.environment.to_s) if jekyll.respond_to?(:environment)
|
|
179
|
+
|
|
180
|
+
markup
|
|
181
|
+
rescue StandardError => e
|
|
182
|
+
logger.error { e.full_message }
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Sanitizes variable names to prevent regex injection attacks
|
|
186
|
+
# @param name [String] the variable name to sanitize
|
|
187
|
+
# @return [String] sanitized variable name
|
|
188
|
+
def self.sanitize_variable_name(name)
|
|
189
|
+
# Allow only alphanumeric characters, underscores, and hyphens
|
|
190
|
+
name.to_s.gsub(/[^a-zA-Z0-9_-]/, '')
|
|
191
|
+
end
|
|
192
|
+
|
|
157
193
|
def self.warn_short_trace(logger, error)
|
|
158
194
|
remaining = error.backtrace.length - DISPLAYED_CALLS
|
|
159
195
|
logger.warn do
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module JekyllSupport
|
|
2
2
|
# Base class for Jekyll tags
|
|
3
3
|
class JekyllTag < Liquid::Tag
|
|
4
|
-
attr_reader :argument_string, :helper, :line_number, :logger, :page, :site
|
|
4
|
+
attr_reader :argument_string, :helper, :highlighter_prefix, :highlighter_suffix, :jekyll_version, :line_number, :logger, :page, :raw_content, :site
|
|
5
5
|
|
|
6
6
|
# See https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers#create-your-own-tags
|
|
7
7
|
# @param tag_name [String] the name of the tag, which we usually know.
|
|
@@ -55,9 +55,13 @@ module JekyllSupport
|
|
|
55
55
|
set_error_context
|
|
56
56
|
|
|
57
57
|
# @envs.keys are :content, :highlighter_prefix, :highlighter_suffix, :jekyll, :layout, :page, :paginator, :site, :theme
|
|
58
|
-
@
|
|
59
|
-
@
|
|
60
|
-
@
|
|
58
|
+
@highlighter_prefix = @envs[:highlighter_prefix]
|
|
59
|
+
@highlighter_suffix = @envs[:highlighter_suffix]
|
|
60
|
+
@jekyll_version = @envs[:jekyll]['version']
|
|
61
|
+
@layout = @envs[:layout]
|
|
62
|
+
@paginator = @envs[:paginator]
|
|
63
|
+
@raw_content = @envs[:content]
|
|
64
|
+
@theme = @envs[:theme]
|
|
61
65
|
|
|
62
66
|
env = @config['env']
|
|
63
67
|
@mode = env&.key?('JEKYLL_ENV') ? env['JEKYLL_ENV'] : 'development'
|
|
@@ -88,7 +92,7 @@ module JekyllSupport
|
|
|
88
92
|
|
|
89
93
|
# Jekyll plugins must override this method, not render, so their plugin can be tested more easily
|
|
90
94
|
# The following variables are predefined:
|
|
91
|
-
# @argument_string, @config, @envs, @helper, @layout, @logger, @mode, @page, @paginator, @site, @tag_name and @theme
|
|
95
|
+
# @argument_string, @config, @envs, @helper, @highlighter_prefix, @highlighter_suffix, @layout, @logger, @mode, @page, @paginator, @raw_content, @site, @tag_name and @theme
|
|
92
96
|
def render_impl
|
|
93
97
|
abort "#{self.class}.render_impl for tag #{@tag_name} must be overridden, but it was not."
|
|
94
98
|
end
|
data/spec/status_persistence.txt
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
example_id | status | run_time |
|
|
2
2
|
----------------------------------------------------------------- | ------- | --------------- |
|
|
3
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:1] | passed | 0.
|
|
4
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:2] | passed | 0.
|
|
5
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:3] | passed | 0.
|
|
6
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:4] | passed | 0.
|
|
7
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:5] | passed | 0.
|
|
8
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:6] | passed | 0.
|
|
9
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:7] | passed | 0.
|
|
10
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:8] | passed | 0.
|
|
11
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:9] | passed | 0.
|
|
12
|
-
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:10] | passed | 0.
|
|
13
|
-
./spec/bsearch_spec.rb[1:1] | pending | 0.
|
|
14
|
-
./spec/bsearch_spec.rb[1:2] | pending | 0.
|
|
15
|
-
./spec/custom_error_spec.rb[1:1] | passed | 0.
|
|
16
|
-
./spec/custom_error_spec.rb[2:1] | passed | 0.
|
|
17
|
-
./spec/date_sort_spec.rb[1:1] | passed | 0.
|
|
18
|
-
./spec/date_sort_spec.rb[1:2] | passed | 0.
|
|
19
|
-
./spec/date_sort_spec.rb[1:3] | passed | 0.
|
|
20
|
-
./spec/date_sort_spec.rb[1:4] | passed | 0.
|
|
21
|
-
./spec/date_sort_spec.rb[1:5] | passed | 0.
|
|
22
|
-
./spec/date_sort_spec.rb[1:6] | passed | 0.
|
|
23
|
-
./spec/date_sort_spec.rb[1:7] | passed | 0.
|
|
24
|
-
./spec/date_sort_spec.rb[1:8] | passed | 0.
|
|
25
|
-
./spec/date_sort_spec.rb[1:9] | passed | 0.
|
|
26
|
-
./spec/date_sort_spec.rb[1:10] | passed | 0.
|
|
27
|
-
./spec/expand_env_spec.rb[1:1] | passed | 0.
|
|
28
|
-
./spec/expand_env_spec.rb[1:2] | passed |
|
|
29
|
-
./spec/expand_env_spec.rb[1:3] | passed |
|
|
30
|
-
./spec/
|
|
31
|
-
./spec/jekyll_plugin_helper_options_spec.rb[1:
|
|
32
|
-
./spec/jekyll_plugin_helper_options_spec.rb[1:
|
|
33
|
-
./spec/jekyll_plugin_helper_options_spec.rb[1:
|
|
34
|
-
./spec/
|
|
35
|
-
./spec/
|
|
36
|
-
./spec/mslinn_binary_search_spec.rb[1:
|
|
37
|
-
./spec/mslinn_binary_search_spec.rb[1:
|
|
38
|
-
./spec/
|
|
39
|
-
./spec/send_chain_spec.rb[1:
|
|
40
|
-
./spec/send_chain_spec.rb[1:
|
|
41
|
-
./spec/send_chain_spec.rb[1:
|
|
42
|
-
./spec/send_chain_spec.rb[1:
|
|
43
|
-
./spec/send_chain_spec.rb[1:
|
|
44
|
-
./spec/send_chain_spec.rb[1:
|
|
45
|
-
./spec/
|
|
46
|
-
./spec/send_spec.rb[1:
|
|
47
|
-
./spec/
|
|
48
|
-
./spec/sorted_lru_files_spec.rb[1:
|
|
3
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:1] | passed | 0.00227 seconds |
|
|
4
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:2] | passed | 0.00075 seconds |
|
|
5
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:3] | passed | 0.00059 seconds |
|
|
6
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:4] | passed | 0.00367 seconds |
|
|
7
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:5] | passed | 0.0008 seconds |
|
|
8
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:6] | passed | 0.00104 seconds |
|
|
9
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:7] | passed | 0.00067 seconds |
|
|
10
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:8] | passed | 0.00079 seconds |
|
|
11
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:9] | passed | 0.00065 seconds |
|
|
12
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:10] | passed | 0.00245 seconds |
|
|
13
|
+
./spec/bsearch_spec.rb[1:1] | pending | 0.00005 seconds |
|
|
14
|
+
./spec/bsearch_spec.rb[1:2] | pending | 0.00038 seconds |
|
|
15
|
+
./spec/custom_error_spec.rb[1:1] | passed | 0.00211 seconds |
|
|
16
|
+
./spec/custom_error_spec.rb[2:1] | passed | 0.00182 seconds |
|
|
17
|
+
./spec/date_sort_spec.rb[1:1] | passed | 0.00019 seconds |
|
|
18
|
+
./spec/date_sort_spec.rb[1:2] | passed | 0.00069 seconds |
|
|
19
|
+
./spec/date_sort_spec.rb[1:3] | passed | 0.00051 seconds |
|
|
20
|
+
./spec/date_sort_spec.rb[1:4] | passed | 0.00006 seconds |
|
|
21
|
+
./spec/date_sort_spec.rb[1:5] | passed | 0.00067 seconds |
|
|
22
|
+
./spec/date_sort_spec.rb[1:6] | passed | 0.00007 seconds |
|
|
23
|
+
./spec/date_sort_spec.rb[1:7] | passed | 0.00062 seconds |
|
|
24
|
+
./spec/date_sort_spec.rb[1:8] | passed | 0.00007 seconds |
|
|
25
|
+
./spec/date_sort_spec.rb[1:9] | passed | 0.0005 seconds |
|
|
26
|
+
./spec/date_sort_spec.rb[1:10] | passed | 0.00008 seconds |
|
|
27
|
+
./spec/expand_env_spec.rb[1:1] | passed | 0.00007 seconds |
|
|
28
|
+
./spec/expand_env_spec.rb[1:2] | passed | 0.00003 seconds |
|
|
29
|
+
./spec/expand_env_spec.rb[1:3] | passed | 1.66 seconds |
|
|
30
|
+
./spec/expand_env_spec.rb[1:4] | passed | 0.00131 seconds |
|
|
31
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:1] | passed | 0.00014 seconds |
|
|
32
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:2] | passed | 0.00058 seconds |
|
|
33
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:3] | passed | 0.00169 seconds |
|
|
34
|
+
./spec/jekyll_plugin_helper_options_spec.rb[1:4] | passed | 0.00091 seconds |
|
|
35
|
+
./spec/liquid_variable_parsing_spec.rb[1:1] | passed | 0.00126 seconds |
|
|
36
|
+
./spec/mslinn_binary_search_spec.rb[1:1] | passed | 0.0027 seconds |
|
|
37
|
+
./spec/mslinn_binary_search_spec.rb[1:2] | passed | 0.00006 seconds |
|
|
38
|
+
./spec/mslinn_binary_search_spec.rb[1:3] | passed | 0.00004 seconds |
|
|
39
|
+
./spec/send_chain_spec.rb[1:1] | passed | 0.00003 seconds |
|
|
40
|
+
./spec/send_chain_spec.rb[1:2] | passed | 0.00004 seconds |
|
|
41
|
+
./spec/send_chain_spec.rb[1:3] | passed | 0.00003 seconds |
|
|
42
|
+
./spec/send_chain_spec.rb[1:4] | passed | 0.00003 seconds |
|
|
43
|
+
./spec/send_chain_spec.rb[1:5] | passed | 0.00003 seconds |
|
|
44
|
+
./spec/send_chain_spec.rb[1:6] | passed | 0.00003 seconds |
|
|
45
|
+
./spec/send_chain_spec.rb[1:7] | passed | 0.00003 seconds |
|
|
46
|
+
./spec/send_spec.rb[1:1] | passed | 0.00022 seconds |
|
|
47
|
+
./spec/send_spec.rb[1:2] | passed | 0.00004 seconds |
|
|
48
|
+
./spec/sorted_lru_files_spec.rb[1:1] | passed | 0.00009 seconds |
|
|
49
|
+
./spec/sorted_lru_files_spec.rb[1:2] | passed | 0.00007 seconds |
|
|
49
50
|
./spec/sorted_lru_files_spec.rb[1:3] | passed | 0.00003 seconds |
|
|
50
|
-
./spec/sorted_lru_files_spec.rb[1:4] | passed | 0.
|
|
51
|
+
./spec/sorted_lru_files_spec.rb[1:4] | passed | 0.00005 seconds |
|
|
51
52
|
./spec/testable_spec.rb[1:1] | passed | 0.00003 seconds |
|
|
52
53
|
./spec/testable_spec.rb[2:1] | passed | 0.00003 seconds |
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll_plugin_support
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Slinn
|
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
182
182
|
- !ruby/object:Gem::Version
|
|
183
183
|
version: '0'
|
|
184
184
|
requirements: []
|
|
185
|
-
rubygems_version:
|
|
185
|
+
rubygems_version: 4.0.11
|
|
186
186
|
specification_version: 4
|
|
187
187
|
summary: Provides a framework for writing and testing Jekyll plugins
|
|
188
188
|
test_files:
|