jekyll-optional-front-matter 0.3.3 → 0.3.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 256286d5e37418605dcfff4045918e459575542b56e64f59d72044991d9f052c
|
|
4
|
+
data.tar.gz: 415a9ebd808dc1fa8171e4a8fcbc848d59c16f7196cc38312a65c383c3be2746
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f217c725fb604e2147bcb5709ee818ec908b9d940b405f2f6d6ea3eb24912bb761c5093d12a551b653fb26612722ad421edee13f936092ccb1632c3060d6510
|
|
7
|
+
data.tar.gz: 67676b4ce80ec3a5696e950f3a2d023e2d6791995300cbe4b19e1da1f2731d292f8c69f6c787227866e224d91d5eaa58c9f36eda3c9bed929d6cb522842ca6ab
|
|
@@ -26,23 +26,17 @@ module JekyllOptionalFrontMatter
|
|
|
26
26
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
|
-
#
|
|
30
|
-
def convert_content(page)
|
|
31
|
-
renderer = Jekyll::Renderer.new(site, page)
|
|
32
|
-
page.content = renderer.convert(page.content)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# An array of Jekyll::Pages to add, *excluding* blacklisted files
|
|
29
|
+
# An array of Jekyll::Pages to add, *excluding* denylisted files
|
|
36
30
|
def pages_to_add
|
|
37
|
-
pages.reject { |page|
|
|
31
|
+
pages.reject { |page| denylisted?(page) }
|
|
38
32
|
end
|
|
39
33
|
|
|
40
|
-
# An array of Jekyll::StaticFile's, *excluding*
|
|
34
|
+
# An array of Jekyll::StaticFile's, *excluding* denylisted files
|
|
41
35
|
def static_files_to_remove
|
|
42
|
-
markdown_files.reject { |page|
|
|
36
|
+
markdown_files.reject { |page| denylisted?(page) }
|
|
43
37
|
end
|
|
44
38
|
|
|
45
|
-
# An array of potential Jekyll::Pages to add, *including*
|
|
39
|
+
# An array of potential Jekyll::Pages to add, *including* denylisted files
|
|
46
40
|
def pages
|
|
47
41
|
markdown_files.map { |static_file| page_from_static_file(static_file) }
|
|
48
42
|
end
|
|
@@ -60,14 +54,15 @@ module JekyllOptionalFrontMatter
|
|
|
60
54
|
Jekyll::Page.new(site, base, dir, name)
|
|
61
55
|
end
|
|
62
56
|
|
|
63
|
-
# Does the given Jekyll::Page match our filename
|
|
64
|
-
def
|
|
65
|
-
return false if
|
|
57
|
+
# Does the given Jekyll::Page match our filename denylist?
|
|
58
|
+
def denylisted?(page)
|
|
59
|
+
return false if explicitly_included?(page)
|
|
66
60
|
|
|
67
|
-
|
|
61
|
+
FILENAME_DENYLIST.include?(page.basename.upcase)
|
|
68
62
|
end
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
# Is the given Jekyll::Page explicitly listed in the site's `include` config?
|
|
65
|
+
def explicitly_included?(page)
|
|
71
66
|
return false unless site.config["include"].is_a? Array
|
|
72
67
|
|
|
73
68
|
entry_filter.included?(page.relative_path)
|
|
@@ -82,11 +77,14 @@ module JekyllOptionalFrontMatter
|
|
|
82
77
|
end
|
|
83
78
|
|
|
84
79
|
def option(key)
|
|
85
|
-
|
|
80
|
+
config = site.config[CONFIG_KEY]
|
|
81
|
+
config[key] if config.is_a?(Hash)
|
|
86
82
|
end
|
|
87
83
|
|
|
84
|
+
# `optional_front_matter: false` is shorthand for `enabled: false`
|
|
88
85
|
def disabled?
|
|
89
|
-
option(ENABLED_KEY) == false ||
|
|
86
|
+
site.config[CONFIG_KEY] == false || option(ENABLED_KEY) == false ||
|
|
87
|
+
site.config["require_front_matter"]
|
|
90
88
|
end
|
|
91
89
|
|
|
92
90
|
def cleanup?
|
|
@@ -7,7 +7,7 @@ module JekyllOptionalFrontMatter
|
|
|
7
7
|
# Case-insensitive array of filenames to exclude. All files must first
|
|
8
8
|
# match the config-defined list of markdown extensions. If you'd like one
|
|
9
9
|
# of these files included in your site, simply add YAML front matter to it.
|
|
10
|
-
|
|
10
|
+
FILENAME_DENYLIST = %w(
|
|
11
11
|
README
|
|
12
12
|
LICENSE
|
|
13
13
|
LICENCE
|
|
@@ -17,4 +17,8 @@ module JekyllOptionalFrontMatter
|
|
|
17
17
|
ISSUE_TEMPLATE
|
|
18
18
|
PULL_REQUEST_TEMPLATE
|
|
19
19
|
).freeze
|
|
20
|
+
|
|
21
|
+
# Deprecated: use FILENAME_DENYLIST. Kept so existing callers don't break.
|
|
22
|
+
FILENAME_BLACKLIST = FILENAME_DENYLIST
|
|
23
|
+
deprecate_constant :FILENAME_BLACKLIST
|
|
20
24
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-optional-front-matter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Balter
|
|
@@ -43,6 +43,20 @@ dependencies:
|
|
|
43
43
|
- - "~>"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: '1.0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rake
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '13.0'
|
|
53
|
+
type: :development
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - "~>"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '13.0'
|
|
46
60
|
- !ruby/object:Gem::Dependency
|
|
47
61
|
name: rspec
|
|
48
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -169,6 +183,8 @@ dependencies:
|
|
|
169
183
|
- - ">="
|
|
170
184
|
- !ruby/object:Gem::Version
|
|
171
185
|
version: '0'
|
|
186
|
+
description: Jekyll plugin to render Markdown files that have no YAML front matter.
|
|
187
|
+
Supported on GitHub Pages.
|
|
172
188
|
email:
|
|
173
189
|
- ben.balter@github.com
|
|
174
190
|
executables: []
|
|
@@ -181,7 +197,11 @@ files:
|
|
|
181
197
|
homepage: https://github.com/benbalter/jekyll-optional-front-matter
|
|
182
198
|
licenses:
|
|
183
199
|
- MIT
|
|
184
|
-
metadata:
|
|
200
|
+
metadata:
|
|
201
|
+
homepage_uri: https://github.com/benbalter/jekyll-optional-front-matter
|
|
202
|
+
source_code_uri: https://github.com/benbalter/jekyll-optional-front-matter
|
|
203
|
+
bug_tracker_uri: https://github.com/benbalter/jekyll-optional-front-matter/issues
|
|
204
|
+
changelog_uri: https://github.com/benbalter/jekyll-optional-front-matter/releases
|
|
185
205
|
rdoc_options: []
|
|
186
206
|
require_paths:
|
|
187
207
|
- lib
|
|
@@ -189,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
189
209
|
requirements:
|
|
190
210
|
- - ">="
|
|
191
211
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: '
|
|
212
|
+
version: '3.0'
|
|
193
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
214
|
requirements:
|
|
195
215
|
- - ">="
|
|
196
216
|
- !ruby/object:Gem::Version
|
|
197
217
|
version: '0'
|
|
198
218
|
requirements: []
|
|
199
|
-
rubygems_version: 4.0.
|
|
219
|
+
rubygems_version: 4.0.20
|
|
200
220
|
specification_version: 4
|
|
201
221
|
summary: A Jekyll plugin to make front matter optional for Markdown files
|
|
202
222
|
test_files: []
|