jekyll-optional-front-matter 0.3.4 → 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,17 +26,17 @@ module JekyllOptionalFrontMatter
|
|
|
26
26
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
|
-
# An array of Jekyll::Pages to add, *excluding*
|
|
29
|
+
# An array of Jekyll::Pages to add, *excluding* denylisted files
|
|
30
30
|
def pages_to_add
|
|
31
|
-
pages.reject { |page|
|
|
31
|
+
pages.reject { |page| denylisted?(page) }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# An array of Jekyll::StaticFile's, *excluding*
|
|
34
|
+
# An array of Jekyll::StaticFile's, *excluding* denylisted files
|
|
35
35
|
def static_files_to_remove
|
|
36
|
-
markdown_files.reject { |page|
|
|
36
|
+
markdown_files.reject { |page| denylisted?(page) }
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
# An array of potential Jekyll::Pages to add, *including*
|
|
39
|
+
# An array of potential Jekyll::Pages to add, *including* denylisted files
|
|
40
40
|
def pages
|
|
41
41
|
markdown_files.map { |static_file| page_from_static_file(static_file) }
|
|
42
42
|
end
|
|
@@ -54,14 +54,15 @@ module JekyllOptionalFrontMatter
|
|
|
54
54
|
Jekyll::Page.new(site, base, dir, name)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
# Does the given Jekyll::Page match our filename
|
|
58
|
-
def
|
|
59
|
-
return false if
|
|
57
|
+
# Does the given Jekyll::Page match our filename denylist?
|
|
58
|
+
def denylisted?(page)
|
|
59
|
+
return false if explicitly_included?(page)
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
FILENAME_DENYLIST.include?(page.basename.upcase)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
# Is the given Jekyll::Page explicitly listed in the site's `include` config?
|
|
65
|
+
def explicitly_included?(page)
|
|
65
66
|
return false unless site.config["include"].is_a? Array
|
|
66
67
|
|
|
67
68
|
entry_filter.included?(page.relative_path)
|
|
@@ -76,11 +77,14 @@ module JekyllOptionalFrontMatter
|
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
def option(key)
|
|
79
|
-
|
|
80
|
+
config = site.config[CONFIG_KEY]
|
|
81
|
+
config[key] if config.is_a?(Hash)
|
|
80
82
|
end
|
|
81
83
|
|
|
84
|
+
# `optional_front_matter: false` is shorthand for `enabled: false`
|
|
82
85
|
def disabled?
|
|
83
|
-
option(ENABLED_KEY) == false ||
|
|
86
|
+
site.config[CONFIG_KEY] == false || option(ENABLED_KEY) == false ||
|
|
87
|
+
site.config["require_front_matter"]
|
|
84
88
|
end
|
|
85
89
|
|
|
86
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
|
|
@@ -202,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
202
216
|
- !ruby/object:Gem::Version
|
|
203
217
|
version: '0'
|
|
204
218
|
requirements: []
|
|
205
|
-
rubygems_version:
|
|
219
|
+
rubygems_version: 4.0.20
|
|
206
220
|
specification_version: 4
|
|
207
221
|
summary: A Jekyll plugin to make front matter optional for Markdown files
|
|
208
222
|
test_files: []
|