jekyll_draft 2.0.1 → 2.0.2
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 +13 -0
- data/README.md +238 -52
- data/jekyll_draft.gemspec +1 -1
- data/lib/draft_html.rb +1 -1
- data/lib/else.rb +2 -2
- data/lib/if_draft.rb +4 -4
- data/lib/jekyll_draft/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b48bd7048b0c4eb3836226b81c8da703f6573e5a564bf5c9ef22733be35167
|
4
|
+
data.tar.gz: 0ebe1a2cbbea83bb3f47fb3e512203a6aebfde0248cff99266e74a66536c99d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4383047a610783981f175d29ccc86212c9b76a571ef587d06d29b487c3895e3e73737559ceeea25f4d849fe3a1fd5c64994b035378095ad355948f0bffe032b5
|
7
|
+
data.tar.gz: d2b9ec0decefb9c1b238c498c5a36735b1033362ff327c3d06760c9d0ce6a4e26bd2f657758403664f0b8a04914e8ad9396bdf6f383cac031849a2534d4e89dd
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 2.0.2 / 2024-07-24
|
4
|
+
|
5
|
+
* Compatible with `jekyll_plugin_support` v1.0.0
|
6
|
+
|
7
|
+
|
8
|
+
## 2.0.1 / 2024-02-07
|
9
|
+
|
10
|
+
* Added Jekyll block tags `if_secret` and `unless_secret`.
|
11
|
+
* Added Jekyll inline tags: `unless_draft_only`, `else_if_secret` and `else_if_not_secret`.
|
12
|
+
* Added Liquid filter: `is_secret`.
|
13
|
+
* Added method `draft_only?` and `secret?` to API module `Jekyll::Draft`.
|
14
|
+
|
15
|
+
|
3
16
|
## 2.0.1 / 2023-11-30
|
4
17
|
|
5
18
|
* Jekyll block tags: `if_draft` and `unless_draft`.
|
data/README.md
CHANGED
@@ -1,24 +1,37 @@
|
|
1
1
|
# jekyll_draft [](https://badge.fury.io/rb/jekyll_draft)
|
2
2
|
|
3
|
-
|
3
|
+
Jekyll has various ways of specifying that a page or document is
|
4
|
+
visible when the website is published in `production` mode.
|
5
|
+
The Jekyll documentation is scattered and incomplete regarding this topic.
|
6
|
+
This plugin’s filters provide a simple means for marking draft pages in `development` mode.
|
7
|
+
|
8
|
+
A secret document is a special form of a draft document.
|
9
|
+
Secrets are always drafts, but not the converse.
|
10
|
+
|
11
|
+
`Jekyll_draft` provides the following:
|
4
12
|
|
5
13
|
* Jekyll block tags: `if_draft` and `unless_draft`.
|
6
|
-
* Jekyll
|
7
|
-
|
14
|
+
* Jekyll block tags: `if_secret` and `unless_secret`.
|
15
|
+
* Jekyll inline tags: `else_if_not_draft`, `else_if_draft`, `else_if_not_secret` and `else_if_secret`.
|
16
|
+
These are meant for use within `if_draft`, `unless_draft`, `if_secret` and `unless_secret`, respectively.
|
8
17
|
Both of them are identical; they are both provided so usage seems natural.
|
9
|
-
* Jekyll inline tag `draft_html`, which generates HTML that indicates if the document
|
18
|
+
* Jekyll inline tag `draft_html`, which generates HTML that indicates if the document
|
19
|
+
it is embedded within is a draft or a secret.
|
10
20
|
* Liquid filters:
|
11
21
|
* `is_draft` returns a boolean indicating if the document passed to it is a draft.
|
22
|
+
* `is_secret` returns a boolean indicating if the document passed to it is a secret.
|
12
23
|
* `draft_html` returns the same string the `draft_html` tag returns,
|
13
24
|
indicating if the document passed to it is a draft.
|
14
25
|
* Module `Jekyll::Draft` defines an API that your plugin can call.
|
15
26
|
It has the following methods:
|
16
|
-
* `draft?` returns a boolean indicating if the document passed to it is a draft.
|
27
|
+
* `draft?` returns a boolean indicating if the document passed to it is a draft or a secret.
|
28
|
+
* `draft_only?` returns a boolean indicating if the document passed to it is a draft and not a secret.
|
17
29
|
* `draft_html` returns the same string that `draft_html` tag returns;
|
18
30
|
the response indicates if the document passed to it is a draft.
|
19
31
|
* `root` returns the path to the root of the collection that the document passed to it is a member of.
|
20
32
|
This method is not functionally related to Jekyll draft documents;
|
21
33
|
it should be packaged separately ... maybe one day...
|
34
|
+
* `secret?` returns a boolean indicating if the document passed to it is a draft.
|
22
35
|
|
23
36
|
The difference between the tag called `draft_html` and the filter of the same name
|
24
37
|
is that the tag only works on the document that it is embedded in,
|
@@ -28,11 +41,38 @@ Both the tag and the filter call the same API methods defined in the `Jekyll::Dr
|
|
28
41
|
More information is available on [Mike Slinn’s website](https://www.mslinn.com/jekyll_plugins/jekyll_draft.html).
|
29
42
|
|
30
43
|
|
44
|
+
## Front Matter
|
45
|
+
|
46
|
+
To mark a blog as a draft, put it in the `_drafts` directory.
|
47
|
+
|
48
|
+
To mark any other article as a draft, add the following to its front matter:
|
49
|
+
|
50
|
+
```text
|
51
|
+
published: false
|
52
|
+
```
|
53
|
+
|
54
|
+
To mark any article (including blog posts) as a secret, add the following to its front matter:
|
55
|
+
|
56
|
+
```text
|
57
|
+
secret: true
|
58
|
+
```
|
59
|
+
|
60
|
+
Secret documents are a type of draft document, so the above implies:
|
61
|
+
|
62
|
+
```text
|
63
|
+
published: false
|
64
|
+
secret: true
|
65
|
+
```
|
66
|
+
|
67
|
+
|
31
68
|
## Demo
|
32
69
|
|
33
70
|
The [demo](demo) subdirectory has working examples of this Jekyll plugin's functionality
|
34
71
|
in a demonstration website.
|
35
|
-
|
72
|
+
It can be used to debug the plugin or it can run freely.
|
73
|
+
Please examine the <code>HTML</code> files in the demo to see how the plugin works.
|
74
|
+
|
75
|
+
To run the demo freely from the command line, type:
|
36
76
|
|
37
77
|
```console
|
38
78
|
$ demo/_bin/debug -r
|
@@ -56,64 +96,113 @@ so you can learn how to write Jekyll pages that include this functionality.
|
|
56
96
|
|
57
97
|
### For Use In A Jekyll Website
|
58
98
|
|
59
|
-
Add the CSS found in [`demo/assets/css/jekyll_draft.css`](demo/assets/css/jekyll_draft.css) to your Jekyll layout(s).
|
99
|
+
1. Add the CSS found in [`demo/assets/css/jekyll_draft.css`](demo/assets/css/jekyll_draft.css) to your Jekyll layout(s).
|
60
100
|
|
61
|
-
Add the following to your Jekyll website's `Gemfile`, within the `jekyll_plugins` group:
|
101
|
+
2. Add the following to your Jekyll website's `Gemfile`, within the `jekyll_plugins` group:
|
62
102
|
|
63
|
-
```ruby
|
64
|
-
group :jekyll_plugins do
|
65
|
-
|
66
|
-
end
|
67
|
-
```
|
103
|
+
```ruby
|
104
|
+
group :jekyll_plugins do
|
105
|
+
gem 'jekyll_draft', '>2.0.0' # v2.0.0 was a dud, do not use it
|
106
|
+
end
|
107
|
+
```
|
68
108
|
|
69
|
-
|
109
|
+
3. Type:
|
70
110
|
|
71
|
-
```shell
|
72
|
-
$ bundle
|
73
|
-
```
|
111
|
+
```shell
|
112
|
+
$ bundle
|
113
|
+
```
|
74
114
|
|
75
115
|
|
76
116
|
### For Use In a Gem
|
77
117
|
|
78
|
-
Add the following to your gem’s `.gemspec`:
|
118
|
+
1. Add the following to your gem’s `.gemspec`:
|
79
119
|
|
80
|
-
```ruby
|
81
|
-
spec.add_dependency 'jekyll_draft', '>2.0.0' # v2.0.0 was a dud, do not use it
|
82
|
-
```
|
120
|
+
```ruby
|
121
|
+
spec.add_dependency 'jekyll_draft', '>2.0.0' # v2.0.0 was a dud, do not use it
|
122
|
+
```
|
83
123
|
|
84
|
-
|
124
|
+
2. Type:
|
85
125
|
|
86
|
-
```shell
|
87
|
-
$ bundle
|
88
|
-
```
|
126
|
+
```shell
|
127
|
+
$ bundle
|
128
|
+
```
|
89
129
|
|
90
130
|
|
91
|
-
## Usage
|
131
|
+
## Usage in a Web Page
|
92
132
|
|
93
|
-
### `if_draft` and `
|
133
|
+
### `if_draft`, `unless_draft`, `if_secret` and `unless_secret` Block Tags
|
94
134
|
|
95
|
-
The `if_draft` block
|
135
|
+
The `if_draft` and `if_secret` block tags acts as `if-then` or `if-then-else` programming constructs.
|
136
|
+
|
137
|
+
The following generates `<p>This is a draft or a secret document!</p>`
|
138
|
+
if the document it is embedded in is a draft, and the Jekyll website generation was performed in development mode:
|
96
139
|
|
97
140
|
```html
|
98
141
|
{% if_draft %}
|
142
|
+
<p>This is a draft or a secret document!</p>
|
143
|
+
{% endif_draft %}
|
144
|
+
```
|
145
|
+
|
146
|
+
The following generates `<p>This is a draft document!</p>`
|
147
|
+
if the document it is embedded in is a draft and not a secret, and the Jekyll website generation was performed in development mode:
|
148
|
+
|
149
|
+
```html
|
150
|
+
{% if_draft_only %}
|
99
151
|
<p>This is a draft document!</p>
|
100
152
|
{% endif_draft %}
|
101
153
|
```
|
102
154
|
|
155
|
+
The following generates `<p>This is a secret document!</p>`
|
156
|
+
if the document it is embedded in is a secret, and the Jekyll website generation was performed in development mode:
|
157
|
+
|
158
|
+
```html
|
159
|
+
{% if_secret %}
|
160
|
+
<p>This is a secret document!</p>
|
161
|
+
{% endif_draft %}
|
162
|
+
```
|
163
|
+
|
164
|
+
The following enhances the previous example by also generating `<p>This is not a draft or a secret document!</p>`
|
165
|
+
when in production mode:
|
166
|
+
|
103
167
|
```html
|
104
168
|
{% if_draft %}
|
105
|
-
<p>This is a draft document!</p>
|
169
|
+
<p>This is a draft or a secret document!</p>
|
170
|
+
{% else_if_not_secret %}
|
171
|
+
<p>This is not a secret document, but might be a draft!</p>
|
106
172
|
{% else_if_not_draft %}
|
107
|
-
<p>This is not a draft document!</p>
|
173
|
+
<p>This is not a draft or a secret document!</p>
|
108
174
|
{% endif_draft %}
|
109
175
|
```
|
110
176
|
|
111
|
-
The `unless_draft` block
|
112
|
-
|
177
|
+
The `unless_draft`, `unless_draft_only` and `unless_secret` block tags acts as Ruby
|
178
|
+
[unless-then](https://rubystyle.guide/#unless-for-negatives) or
|
179
|
+
an [unless-then-else](https://rubystyle.guide/#no-else-with-unless) programming constructs.
|
180
|
+
|
181
|
+
```html
|
182
|
+
{% unless_draft %}
|
183
|
+
<p>This is not a draft or a secret document!</p>
|
184
|
+
{% endunless_draft %}
|
185
|
+
```
|
186
|
+
|
187
|
+
```html
|
188
|
+
{% unless_draft_only %}
|
189
|
+
<p>This is not a draft document, but might be a secret!</p>
|
190
|
+
{% endunless_draft %}
|
191
|
+
```
|
192
|
+
|
193
|
+
```html
|
194
|
+
{% unless_secret %}
|
195
|
+
<p>This is not a secret document, but might be a draft!</p>
|
196
|
+
{% endunless_draft %}
|
197
|
+
```
|
198
|
+
|
199
|
+
This is how you can specify an `else` clause for `unless_draft`:
|
113
200
|
|
114
201
|
```html
|
115
202
|
{% unless_draft %}
|
116
203
|
<p>This is not a draft document!</p>
|
204
|
+
{% else_if_draft %}
|
205
|
+
<p>This is a draft document!</p>
|
117
206
|
{% endunless_draft %}
|
118
207
|
```
|
119
208
|
|
@@ -121,7 +210,11 @@ an [unless-then-else](https://rubystyle.guide/#no-else-with-unless) programming
|
|
121
210
|
{% unless_draft %}
|
122
211
|
<p>This is not a draft document!</p>
|
123
212
|
{% else_if_draft %}
|
213
|
+
<p>This is a draft or a secret document!</p>
|
214
|
+
{% else_if_draft_only %}
|
124
215
|
<p>This is a draft document!</p>
|
216
|
+
{% else_if_secret %}
|
217
|
+
<p>This is a secret document!</p>
|
125
218
|
{% endunless_draft %}
|
126
219
|
```
|
127
220
|
|
@@ -138,19 +231,23 @@ Here is an example of embedding the `draft_html` inline tag into an HTML documen
|
|
138
231
|
<p>Is this a draft document? Look here to see: {% draft_html %}</p>
|
139
232
|
```
|
140
233
|
|
141
|
-
By default,
|
234
|
+
By default, if the document is a draft or a secret, and the Jekyll website generation was performed in development mode,
|
235
|
+
`draft_html` emits ` <i class='jekyll_draft>Draft</i>` or ` <i class='jekyll_secret>Secret</i>` ,
|
142
236
|
otherwise it does not emit anything.
|
143
237
|
|
144
238
|
You can change this behavior several ways:
|
145
239
|
|
146
|
-
* Add the `published_output` parameter to specify the HTML that should be emitted if the document is not a draft
|
240
|
+
* Add the `published_output` parameter to specify the HTML that should be emitted if the document is not a draft or a secret,
|
241
|
+
and the Jekyll website generation was performed in development mode.
|
147
242
|
The default message will continue to be output for draft documents when the `published_output` parameter is used.
|
148
243
|
|
149
244
|
```html
|
150
|
-
{% draft_html published_output="<p>Not a draft</p>" %}
|
245
|
+
{% draft_html published_output="<p>Not a draft or a secret</p>" %}
|
151
246
|
```
|
152
247
|
|
153
|
-
* Add the `draft_output` parameter to specify the HTML that should be emitted if the document is a draft
|
248
|
+
* Add the `draft_output` parameter to specify the HTML that should be emitted if the document is a draft,
|
249
|
+
the `secret_output` parameter to specify the HTML that should be emitted if the document is a secret,
|
250
|
+
and the Jekyll website generation was performed in development mode:
|
154
251
|
|
155
252
|
```html
|
156
253
|
{% draft_html
|
@@ -160,37 +257,95 @@ The default message will continue to be output for draft documents when the `pub
|
|
160
257
|
draft_output="<p>Is a draft</p>"
|
161
258
|
published_output="<p>Not a draft</p>"
|
162
259
|
%}
|
260
|
+
{% draft_html
|
261
|
+
secret_output="<p>Is a secret</p>"
|
262
|
+
%}
|
263
|
+
{% draft_html
|
264
|
+
draft_output="<p>Is a draft</p>"
|
265
|
+
published_output="<p>Not a draft or a secret</p>"
|
266
|
+
secret_output="<p>Is a secret</p>"
|
267
|
+
%}
|
163
268
|
```
|
164
269
|
|
165
270
|
* Add the `draft_class` parameter to specify the CSS class that should be added
|
166
|
-
to the emitted HTML if the document is a draft
|
271
|
+
to the emitted HTML if the document is a draft,
|
272
|
+
add the `secret_class` parameter to specify the CSS class that should be added
|
273
|
+
to the emitted HTML if the document is a secret,
|
274
|
+
and the Jekyll website generation was performed in development mode:
|
167
275
|
|
168
276
|
```html
|
169
277
|
{% draft_html draft_class="my_draft_class" %}
|
170
278
|
{% draft_html
|
171
279
|
draft_class="my_draft_class"
|
172
|
-
published_output="<p>Not a draft</p>"
|
280
|
+
published_output="<p>Not a draft or a secret</p>"
|
281
|
+
%}
|
282
|
+
{% draft_html draft_class="my_draft_class" secret_class="my_secret_class" %}
|
283
|
+
{% draft_html
|
284
|
+
draft_class="my_draft_class"
|
285
|
+
published_output="<p>Not a draft or a secret</p>"
|
286
|
+
secret_class="my_secret_class"
|
173
287
|
%}
|
174
288
|
```
|
175
289
|
|
176
290
|
* Add the `draft_style` parameter to specify the CSS class that should be added
|
177
|
-
to the emitted HTML if the document is a draft
|
291
|
+
to the emitted HTML if the document is a draft,
|
292
|
+
and the Jekyll website generation was performed in development mode:
|
178
293
|
|
179
294
|
```html
|
180
295
|
{% draft_html draft_style="font-size: 24pt;" %}
|
296
|
+
{% draft_html secret_style="font-size: 24pt; color: red;" %}
|
181
297
|
{% draft_html
|
182
298
|
draft_class="my_draft_class"
|
183
299
|
draft_style="font-size: 24pt;"
|
300
|
+
secret_class="my_secret_class"
|
301
|
+
secret_style="font-size: 24pt; color: red;"
|
184
302
|
%}
|
185
303
|
{% draft_html
|
186
304
|
draft_class="my_draft_class"
|
187
305
|
draft_style="font-size: 24pt;"
|
188
|
-
published_output="<p>Not a draft</p>"
|
306
|
+
published_output="<p>Not a draft or a secret</p>"
|
307
|
+
secret_class="my_secret_class"
|
308
|
+
secret_style="font-size: 24pt; color: red;"
|
189
309
|
%}
|
190
310
|
```
|
191
311
|
|
192
312
|
|
193
|
-
### Filters
|
313
|
+
### Liquid Filters
|
314
|
+
|
315
|
+
#### `draft_html`
|
316
|
+
|
317
|
+
By default, the draft_html Liquid filter generates HTML if a page is invisible when published in `production` mode.
|
318
|
+
If the page is not a draft then the empty string is returned.
|
319
|
+
|
320
|
+
The optional parameters for the `draft_html` inline tag are not available for
|
321
|
+
use with the `draft_html` filter.
|
322
|
+
|
323
|
+
The default generated HTML for draft pages is:<br>
|
324
|
+
`" <i class='jekyll_draft'>Draft</i>"`
|
325
|
+
|
326
|
+
The default generated HTML for secret pages is:<br>
|
327
|
+
`" <i class='jekyll_secret'>Secret</i>"`
|
328
|
+
|
329
|
+
Invoke the filter like the following; the output depends on whether the document is a draft or a secret:
|
330
|
+
|
331
|
+
```html
|
332
|
+
{{ page | draft_html }} => " <i class='jekyll_draft'>Draft</i>"
|
333
|
+
{{ page | draft_html }} => " <i class='jekyll_secret'>Secret</i>"
|
334
|
+
```
|
335
|
+
|
336
|
+
Here is a code snippet that shows the <code>draft_html</code> filter in use:
|
337
|
+
|
338
|
+
```html
|
339
|
+
{% assign docs = site.myCollection | sort: "order" %}
|
340
|
+
<ol id="titles">
|
341
|
+
{% for doc in docs %}
|
342
|
+
<li>
|
343
|
+
<a href="{{doc.url}}" class="title">{{doc.title}}</a>{{ doc | draft_html }}
|
344
|
+
</li>
|
345
|
+
{% endfor %}
|
346
|
+
</ol>
|
347
|
+
```
|
348
|
+
|
194
349
|
|
195
350
|
#### `is_draft`
|
196
351
|
|
@@ -198,23 +353,28 @@ This filter detects if a page is invisible when published in `production` mode,
|
|
198
353
|
and either returns `true` or `false`.
|
199
354
|
|
200
355
|
```html
|
201
|
-
{{ page | is_draft }}
|
356
|
+
{{ page | is_draft }} <!-- true for draft and secret documents in development mode -->
|
202
357
|
```
|
203
358
|
|
204
359
|
|
205
|
-
#### `
|
360
|
+
#### `is_draft_only`
|
206
361
|
|
207
|
-
This filter
|
208
|
-
|
209
|
-
The generated HTML for draft pages is:<br>
|
210
|
-
`" <i class='jekyll_draft'>Draft</i>"`
|
362
|
+
This filter detects if a page is invisible when published in `production` mode,
|
363
|
+
and either returns `true` or `false`.
|
211
364
|
|
212
365
|
```html
|
213
|
-
{{ page |
|
366
|
+
{{ page | is_draft_only }} <!-- true for draft documents in development mode, but not secret documents -->
|
214
367
|
```
|
215
368
|
|
216
|
-
|
217
|
-
|
369
|
+
|
370
|
+
#### `is_secret`
|
371
|
+
|
372
|
+
This filter detects if a page is invisible when published in `production` mode,
|
373
|
+
and either returns `true` or `false`.
|
374
|
+
|
375
|
+
```html
|
376
|
+
{{ page | is_secret }} <!-- true for secret documents in development mode, but not draft documents -->
|
377
|
+
```
|
218
378
|
|
219
379
|
|
220
380
|
### Invoking From Another Jekyll Plugin
|
@@ -222,12 +382,38 @@ use with the `draft_html` filter.
|
|
222
382
|
```ruby
|
223
383
|
require 'jekyll_draft'
|
224
384
|
|
225
|
-
puts 'Found a draft' if Jekyll::Draft.is_draft post
|
385
|
+
puts 'Found a draft or a secret' if Jekyll::Draft.is_draft post
|
226
386
|
|
227
|
-
|
387
|
+
draft_or_secret = Jekyll::Draft.draft_html post
|
228
388
|
```
|
229
389
|
|
230
390
|
|
391
|
+
## Usage in a Plugin
|
392
|
+
|
393
|
+
The methods in `lib/draft_html.rb` can be invoked by qualifying them with `Jekyll::Draft`.
|
394
|
+
Here is a complete example of a Jekyll Support plugin that displays an indication of whether the page is a draft or not:
|
395
|
+
|
396
|
+
```ruby
|
397
|
+
require 'jekyll_plugin_support'
|
398
|
+
|
399
|
+
module MyPluginTag
|
400
|
+
MyPluginError = JekyllSupport.define_error
|
401
|
+
PLUGIN_NAME = 'my_plugin'.freeze
|
402
|
+
VERSION = '0.1.0'.freeze
|
403
|
+
|
404
|
+
class MyPluginTag < JekyllSupport::JekyllTag
|
405
|
+
def render_impl
|
406
|
+
<<~HEREDOC
|
407
|
+
Draft or not? #{Jekyll::Draft.draft_html(@page)}
|
408
|
+
HEREDOC
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
Liquid::Template.register_tag(MyPluginTag::PLUGIN_NAME, MyPluginTag::MyPluginTag)
|
414
|
+
PluginMetaLogger.instance.info { "Loaded #{MyPluginTag::PLUGIN_NAME} v#{MyPluginTag::VERSION} plugin." }
|
415
|
+
```
|
416
|
+
|
231
417
|
|
232
418
|
## Development
|
233
419
|
|
data/jekyll_draft.gemspec
CHANGED
@@ -32,5 +32,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
32
32
|
spec.version = DraftVersion::VERSION
|
33
33
|
|
34
34
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
35
|
-
spec.add_dependency 'jekyll_plugin_support'
|
35
|
+
spec.add_dependency 'jekyll_plugin_support', '>=1.0.0'
|
36
36
|
end
|
data/lib/draft_html.rb
CHANGED
data/lib/else.rb
CHANGED
@@ -11,9 +11,9 @@ class ElseBase < JekyllSupport::JekyllTag
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class ElseDraft < ElseBase
|
14
|
-
JekyllPluginHelper.register(self, ELSE_DRAFT)
|
14
|
+
::JekyllSupport::JekyllPluginHelper.register(self, ELSE_DRAFT)
|
15
15
|
end
|
16
16
|
|
17
17
|
class ElseNotDraft < ElseBase
|
18
|
-
JekyllPluginHelper.register(self, ELSE_NOT_DRAFT)
|
18
|
+
::JekyllSupport::JekyllPluginHelper.register(self, ELSE_NOT_DRAFT)
|
19
19
|
end
|
data/lib/if_draft.rb
CHANGED
@@ -11,17 +11,17 @@ class DraftBase < JekyllSupport::JekyllBlock
|
|
11
11
|
raise DraftError, "Warning: More than one else clause detected" if extra
|
12
12
|
|
13
13
|
if @tag_name == IF_DRAFT
|
14
|
-
return Jekyll::Draft.draft?(@page) ? true_value : false_value
|
14
|
+
return ::Jekyll::Draft.draft?(@page) ? true_value : false_value
|
15
15
|
end
|
16
16
|
|
17
|
-
Jekyll::Draft.draft?(@page) ? false_value : true_value
|
17
|
+
::Jekyll::Draft.draft?(@page) ? false_value : true_value
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
class IfDraft < DraftBase
|
22
|
-
JekyllPluginHelper.register(self, IF_DRAFT)
|
22
|
+
::JekyllSupport::JekyllPluginHelper.register(self, IF_DRAFT)
|
23
23
|
end
|
24
24
|
|
25
25
|
class UnlessDraft < DraftBase
|
26
|
-
JekyllPluginHelper.register(self, UNLESS_DRAFT)
|
26
|
+
::JekyllSupport::JekyllPluginHelper.register(self, UNLESS_DRAFT)
|
27
27
|
end
|
data/lib/jekyll_draft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_draft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.0.0
|
41
41
|
description: 'This Jekyll filter detects draft documents.
|
42
42
|
|
43
43
|
'
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.5.16
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: This Jekyll filter detects draft documents.
|