jekyll 3.8.7 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +71 -62
- data/LICENSE +1 -1
- data/README.markdown +46 -17
- data/lib/blank_template/_config.yml +3 -0
- data/lib/blank_template/_layouts/default.html +12 -0
- data/lib/blank_template/_sass/main.scss +9 -0
- data/lib/blank_template/assets/css/main.scss +4 -0
- data/lib/blank_template/index.md +8 -0
- data/lib/jekyll.rb +10 -1
- data/lib/jekyll/cache.rb +190 -0
- data/lib/jekyll/cleaner.rb +5 -4
- data/lib/jekyll/collection.rb +82 -10
- data/lib/jekyll/command.rb +33 -6
- data/lib/jekyll/commands/build.rb +11 -20
- data/lib/jekyll/commands/clean.rb +2 -0
- data/lib/jekyll/commands/doctor.rb +15 -8
- data/lib/jekyll/commands/help.rb +1 -1
- data/lib/jekyll/commands/new.rb +37 -35
- data/lib/jekyll/commands/new_theme.rb +30 -28
- data/lib/jekyll/commands/serve.rb +55 -81
- data/lib/jekyll/commands/serve/live_reload_reactor.rb +6 -10
- data/lib/jekyll/commands/serve/servlet.rb +22 -25
- data/lib/jekyll/commands/serve/websockets.rb +1 -1
- data/lib/jekyll/configuration.rb +61 -149
- data/lib/jekyll/converters/identity.rb +18 -0
- data/lib/jekyll/converters/markdown.rb +49 -40
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +84 -11
- data/lib/jekyll/converters/smartypants.rb +34 -14
- data/lib/jekyll/convertible.rb +30 -31
- data/lib/jekyll/deprecator.rb +1 -3
- data/lib/jekyll/document.rb +89 -61
- data/lib/jekyll/drops/collection_drop.rb +2 -3
- data/lib/jekyll/drops/document_drop.rb +14 -1
- data/lib/jekyll/drops/drop.rb +17 -14
- data/lib/jekyll/drops/excerpt_drop.rb +4 -0
- data/lib/jekyll/drops/page_drop.rb +18 -0
- data/lib/jekyll/drops/site_drop.rb +6 -5
- data/lib/jekyll/drops/unified_payload_drop.rb +1 -0
- data/lib/jekyll/drops/url_drop.rb +53 -1
- data/lib/jekyll/entry_filter.rb +42 -45
- data/lib/jekyll/excerpt.rb +45 -34
- data/lib/jekyll/external.rb +10 -5
- data/lib/jekyll/filters.rb +200 -40
- data/lib/jekyll/filters/date_filters.rb +6 -3
- data/lib/jekyll/filters/grouping_filters.rb +1 -2
- data/lib/jekyll/filters/url_filters.rb +46 -14
- data/lib/jekyll/frontmatter_defaults.rb +46 -35
- data/lib/jekyll/hooks.rb +4 -8
- data/lib/jekyll/inclusion.rb +32 -0
- data/lib/jekyll/liquid_extensions.rb +0 -2
- data/lib/jekyll/liquid_renderer.rb +31 -16
- data/lib/jekyll/liquid_renderer/file.rb +24 -3
- data/lib/jekyll/liquid_renderer/table.rb +36 -77
- data/lib/jekyll/log_adapter.rb +5 -1
- data/lib/jekyll/mime.types +53 -11
- data/lib/jekyll/page.rb +54 -12
- data/lib/jekyll/page_excerpt.rb +26 -0
- data/lib/jekyll/page_without_a_file.rb +0 -4
- data/lib/jekyll/path_manager.rb +31 -0
- data/lib/jekyll/plugin.rb +5 -11
- data/lib/jekyll/plugin_manager.rb +2 -0
- data/lib/jekyll/profiler.rb +58 -0
- data/lib/jekyll/reader.rb +42 -9
- data/lib/jekyll/readers/collection_reader.rb +1 -0
- data/lib/jekyll/readers/data_reader.rb +8 -9
- data/lib/jekyll/readers/layout_reader.rb +3 -12
- data/lib/jekyll/readers/page_reader.rb +5 -5
- data/lib/jekyll/readers/post_reader.rb +31 -18
- data/lib/jekyll/readers/static_file_reader.rb +4 -4
- data/lib/jekyll/readers/theme_assets_reader.rb +8 -5
- data/lib/jekyll/regenerator.rb +4 -12
- data/lib/jekyll/renderer.rb +23 -40
- data/lib/jekyll/site.rb +91 -38
- data/lib/jekyll/static_file.rb +62 -21
- data/lib/jekyll/stevenson.rb +2 -3
- data/lib/jekyll/tags/highlight.rb +19 -51
- data/lib/jekyll/tags/include.rb +82 -42
- data/lib/jekyll/tags/link.rb +11 -7
- data/lib/jekyll/tags/post_url.rb +25 -21
- data/lib/jekyll/theme.rb +16 -18
- data/lib/jekyll/theme_builder.rb +91 -89
- data/lib/jekyll/url.rb +10 -5
- data/lib/jekyll/utils.rb +18 -21
- data/lib/jekyll/utils/ansi.rb +1 -1
- data/lib/jekyll/utils/exec.rb +0 -1
- data/lib/jekyll/utils/internet.rb +2 -4
- data/lib/jekyll/utils/platforms.rb +8 -8
- data/lib/jekyll/utils/thread_event.rb +1 -5
- data/lib/jekyll/utils/win_tz.rb +2 -2
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/.gitignore +2 -0
- data/lib/site_template/404.html +1 -0
- data/lib/site_template/_config.yml +17 -5
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +5 -1
- data/lib/site_template/{about.md → about.markdown} +0 -0
- data/lib/site_template/{index.md → index.markdown} +0 -0
- data/lib/theme_template/gitignore.erb +1 -0
- data/lib/theme_template/theme.gemspec.erb +1 -4
- data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -0
- metadata +69 -31
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +0 -37
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +0 -112
- data/lib/jekyll/utils/rouge.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8de141f536d43289d9c0f6dcea9282eca345760cb15208d11971128f0e9c9b23
|
4
|
+
data.tar.gz: d3f2ed7b92cc8a96b1c56c183912247d60399fb13bf899b874093797d1b8c574
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 188a24d699ba093c3a55048cacb969158cb027a4df37cdc62bd31c22dd8223c8c8b138a190b5eaee85fb811be771fa3e8256bde4b1c8f6fdfbac8a69dbc221c4
|
7
|
+
data.tar.gz: d2eb7caccefdaebfeec3cce77f749d4ade2d463eb39d85ab9f3fe9a54afadc193fcfc7218692124e217843443f0ae9b0a3ee71a9ffb6ececc245fc063c370f1e
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
---
|
2
|
+
inherit_from: .rubocop_todo.yml
|
2
3
|
|
3
4
|
require:
|
5
|
+
- rubocop-performance
|
4
6
|
- ./rubocop/jekyll
|
5
7
|
|
6
8
|
Jekyll/NoPutsAllowed:
|
@@ -8,9 +10,10 @@ Jekyll/NoPutsAllowed:
|
|
8
10
|
- rake/*.rake
|
9
11
|
|
10
12
|
AllCops:
|
11
|
-
TargetRubyVersion: 2.
|
13
|
+
TargetRubyVersion: 2.4
|
12
14
|
Include:
|
13
15
|
- lib/**/*.rb
|
16
|
+
- test/**/*.rb
|
14
17
|
Exclude:
|
15
18
|
- bin/**/*
|
16
19
|
- exe/**/*
|
@@ -18,49 +21,51 @@ AllCops:
|
|
18
21
|
- script/**/*
|
19
22
|
- vendor/**/*
|
20
23
|
- tmp/**/*
|
21
|
-
|
24
|
+
|
25
|
+
Layout/EmptyComment:
|
22
26
|
Enabled: false
|
23
|
-
Layout/
|
27
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
28
|
+
Enabled: true
|
29
|
+
Layout/EndAlignment:
|
30
|
+
Severity: error
|
31
|
+
Layout/HashAlignment:
|
24
32
|
EnforcedHashRocketStyle: table
|
25
|
-
Layout/AlignParameters:
|
26
|
-
Enabled: false
|
27
|
-
Layout/EmptyLinesAroundAccessModifier:
|
28
|
-
Enabled: false
|
29
|
-
Layout/EmptyLinesAroundModuleBody:
|
30
|
-
Enabled: false
|
31
|
-
Layout/EndOfLine:
|
32
|
-
EnforcedStyle: native
|
33
|
-
Layout/ExtraSpacing:
|
34
|
-
AllowForAlignment: true
|
35
|
-
Layout/FirstParameterIndentation:
|
36
|
-
EnforcedStyle: consistent
|
37
33
|
Layout/IndentationWidth:
|
38
34
|
Severity: error
|
39
|
-
Layout/
|
35
|
+
Layout/FirstArrayElementIndentation:
|
40
36
|
EnforcedStyle: consistent
|
41
|
-
Layout/
|
37
|
+
Layout/FirstHashElementIndentation:
|
42
38
|
EnforcedStyle: consistent
|
43
|
-
Layout/
|
44
|
-
|
39
|
+
Layout/LineLength:
|
40
|
+
Exclude:
|
41
|
+
- !ruby/regexp /features\/.*.rb/
|
42
|
+
- Rakefile
|
43
|
+
- rake/*.rake
|
44
|
+
- Gemfile
|
45
|
+
Max: 100
|
46
|
+
Severity: warning
|
45
47
|
Layout/MultilineMethodCallIndentation:
|
46
48
|
EnforcedStyle: indented
|
47
49
|
Layout/MultilineOperationIndentation:
|
48
50
|
EnforcedStyle: indented
|
51
|
+
Layout/SpaceAroundMethodCallOperator:
|
52
|
+
Enabled: true
|
53
|
+
|
49
54
|
Lint/NestedPercentLiteral:
|
50
55
|
Exclude:
|
51
56
|
- test/test_site.rb
|
52
|
-
|
53
|
-
Enabled:
|
54
|
-
|
55
|
-
|
56
|
-
Lint/
|
57
|
-
Enabled:
|
57
|
+
Lint/DeprecatedOpenSSLConstant:
|
58
|
+
Enabled: true
|
59
|
+
Lint/RaiseException:
|
60
|
+
Enabled: true
|
61
|
+
Lint/StructNewOverride:
|
62
|
+
Enabled: true
|
58
63
|
Lint/UnreachableCode:
|
59
64
|
Severity: error
|
60
|
-
Lint/UselessAccessModifier:
|
61
|
-
Enabled: false
|
62
65
|
Lint/Void:
|
63
|
-
|
66
|
+
Exclude:
|
67
|
+
- lib/jekyll/site.rb
|
68
|
+
|
64
69
|
Metrics/AbcSize:
|
65
70
|
Max: 21
|
66
71
|
Metrics/BlockLength:
|
@@ -68,45 +73,44 @@ Metrics/BlockLength:
|
|
68
73
|
- test/**/*.rb
|
69
74
|
- lib/jekyll/configuration.rb
|
70
75
|
- rake/*.rake
|
71
|
-
- jekyll.gemspec
|
72
76
|
Metrics/ClassLength:
|
73
77
|
Exclude:
|
74
78
|
- !ruby/regexp /features\/.*.rb$/
|
75
79
|
- !ruby/regexp /test\/.*.rb$/
|
76
|
-
|
80
|
+
- lib/jekyll/document.rb
|
81
|
+
- lib/jekyll/site.rb
|
82
|
+
- lib/jekyll/commands/serve.rb
|
83
|
+
- lib/jekyll/configuration.rb
|
84
|
+
Max: 240
|
77
85
|
Metrics/CyclomaticComplexity:
|
78
|
-
Max: 9
|
79
|
-
Metrics/LineLength:
|
80
86
|
Exclude:
|
81
|
-
-
|
82
|
-
-
|
83
|
-
- rake/*.rake
|
84
|
-
- Gemfile
|
85
|
-
- jekyll.gemspec
|
86
|
-
Max: 90
|
87
|
-
Severity: warning
|
87
|
+
- lib/jekyll/utils.rb
|
88
|
+
- lib/jekyll/commands/serve.rb
|
88
89
|
Metrics/MethodLength:
|
89
90
|
CountComments: false
|
90
91
|
Max: 20
|
91
92
|
Severity: error
|
92
93
|
Metrics/ModuleLength:
|
93
94
|
Max: 240
|
95
|
+
Exclude:
|
96
|
+
- lib/jekyll/filters.rb
|
94
97
|
Metrics/ParameterLists:
|
95
98
|
Max: 4
|
96
99
|
Metrics/PerceivedComplexity:
|
97
100
|
Max: 8
|
101
|
+
|
98
102
|
Naming/FileName:
|
99
103
|
Enabled: false
|
100
104
|
Naming/HeredocDelimiterNaming:
|
101
|
-
|
105
|
+
Exclude:
|
106
|
+
- test/**/*.rb
|
102
107
|
Naming/MemoizedInstanceVariableName:
|
103
108
|
Exclude:
|
104
|
-
- lib/jekyll/
|
105
|
-
- lib/jekyll/drops/unified_payload_drop.rb
|
109
|
+
- lib/jekyll/convertible.rb
|
106
110
|
- lib/jekyll/drops/site_drop.rb
|
107
|
-
|
108
|
-
|
109
|
-
|
111
|
+
- lib/jekyll/drops/unified_payload_drop.rb
|
112
|
+
- lib/jekyll/page_without_a_file.rb
|
113
|
+
|
110
114
|
Security/MarshalLoad:
|
111
115
|
Exclude:
|
112
116
|
- !ruby/regexp /test\/.*.rb$/
|
@@ -115,34 +119,40 @@ Security/YAMLLoad:
|
|
115
119
|
Exclude:
|
116
120
|
- !ruby/regexp /features\/.*.rb/
|
117
121
|
- !ruby/regexp /test\/.*.rb$/
|
118
|
-
|
122
|
+
|
123
|
+
Style/AccessModifierDeclarations:
|
119
124
|
Enabled: false
|
125
|
+
Style/Alias:
|
126
|
+
EnforcedStyle: prefer_alias_method
|
120
127
|
Style/AndOr:
|
121
128
|
Severity: error
|
122
|
-
Style/BracesAroundHashParameters:
|
123
|
-
Enabled: false
|
124
129
|
Style/ClassAndModuleChildren:
|
125
|
-
|
126
|
-
|
127
|
-
EnforcedStyle: always
|
130
|
+
Exclude:
|
131
|
+
- test/**/*.rb
|
128
132
|
Style/Documentation:
|
129
133
|
Enabled: false
|
130
|
-
Exclude:
|
131
|
-
- !ruby/regexp /features\/.*.rb$/
|
132
134
|
Style/DoubleNegation:
|
133
135
|
Enabled: false
|
136
|
+
Style/ExponentialNotation:
|
137
|
+
Enabled: true
|
134
138
|
Style/FormatStringToken:
|
135
139
|
Exclude:
|
136
140
|
- lib/jekyll/utils/ansi.rb
|
141
|
+
- lib/jekyll/liquid_renderer/table.rb
|
142
|
+
- lib/jekyll/profiler.rb
|
143
|
+
Style/FrozenStringLiteralComment:
|
144
|
+
EnforcedStyle: always
|
137
145
|
Style/GuardClause:
|
138
146
|
Enabled: false
|
147
|
+
Style/HashEachMethods:
|
148
|
+
Enabled: true
|
139
149
|
Style/HashSyntax:
|
140
150
|
EnforcedStyle: hash_rockets
|
141
151
|
Severity: error
|
142
|
-
Style/
|
143
|
-
Enabled: false
|
144
|
-
Style/InverseMethods:
|
152
|
+
Style/HashTransformKeys:
|
145
153
|
Enabled: false
|
154
|
+
Style/HashTransformValues:
|
155
|
+
Enabled: true
|
146
156
|
Style/MixinUsage:
|
147
157
|
Exclude:
|
148
158
|
- test/helper.rb
|
@@ -159,24 +169,23 @@ Style/PercentLiteralDelimiters:
|
|
159
169
|
"%w": "()"
|
160
170
|
"%W": "()"
|
161
171
|
"%x": "()"
|
162
|
-
Style/RedundantReturn:
|
163
|
-
Enabled: false
|
164
|
-
Style/RedundantSelf:
|
165
|
-
Enabled: false
|
166
172
|
Style/RegexpLiteral:
|
167
173
|
EnforcedStyle: percent_r
|
168
174
|
Style/RescueModifier:
|
169
175
|
Enabled: false
|
176
|
+
Style/SafeNavigation:
|
177
|
+
Exclude:
|
178
|
+
- lib/jekyll/document.rb
|
170
179
|
Style/SignalException:
|
171
180
|
EnforcedStyle: only_raise
|
172
|
-
Style/
|
181
|
+
Style/SlicingWithRange:
|
173
182
|
Enabled: false
|
174
183
|
Style/StringLiterals:
|
175
184
|
EnforcedStyle: double_quotes
|
176
185
|
Style/StringLiteralsInInterpolation:
|
177
186
|
EnforcedStyle: double_quotes
|
178
187
|
Style/SymbolArray:
|
179
|
-
|
188
|
+
EnforcedStyle: brackets
|
180
189
|
Style/TrailingCommaInArrayLiteral:
|
181
190
|
EnforcedStyleForMultiline: consistent_comma
|
182
191
|
Style/TrailingCommaInHashLiteral:
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2008-
|
3
|
+
Copyright (c) 2008-present Tom Preston-Werner and Jekyll contributors
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.markdown
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)][ruby-gems]
|
4
4
|
[![Linux Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg?label=Linux%20build)][travis]
|
5
5
|
[![Windows Build status](https://img.shields.io/appveyor/ci/jekyll/jekyll/master.svg?label=Windows%20build)][appveyor]
|
6
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)]
|
7
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)]
|
8
|
-
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)][gemnasium]
|
6
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)][codeclimate]
|
7
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage]
|
9
8
|
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
|
9
|
+
[![Backers on Open Collective](https://opencollective.com/jekyll/backers/badge.svg)](#backers)
|
10
|
+
[![Sponsors on Open Collective](https://opencollective.com/jekyll/sponsors/badge.svg)](#sponsors)
|
10
11
|
|
11
12
|
[ruby-gems]: https://rubygems.org/gems/jekyll
|
12
|
-
[gemnasium]: https://gemnasium.com/jekyll/jekyll
|
13
13
|
[codeclimate]: https://codeclimate.com/github/jekyll/jekyll
|
14
14
|
[coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
|
15
15
|
[hakiri]: https://hakiri.io/github/jekyll/jekyll/master
|
@@ -24,18 +24,28 @@ Jekyll does what you tell it to do — no more, no less. It doesn't try to outs
|
|
24
24
|
|
25
25
|
See: https://jekyllrb.com/philosophy
|
26
26
|
|
27
|
-
## Having trouble?
|
28
|
-
|
29
|
-
See: https://jekyllrb.com/docs/troubleshooting/
|
30
|
-
|
31
27
|
## Getting Started
|
32
28
|
|
33
29
|
* [Install](https://jekyllrb.com/docs/installation/) the gem
|
34
30
|
* Read up about its [Usage](https://jekyllrb.com/docs/usage/) and [Configuration](https://jekyllrb.com/docs/configuration/)
|
35
|
-
* Take a gander at some existing [Sites](https://
|
31
|
+
* Take a gander at some existing [Sites](https://github.com/jekyll/jekyll/wiki/sites)
|
36
32
|
* [Fork](https://github.com/jekyll/jekyll/fork) and [Contribute](https://jekyllrb.com/docs/contributing/) your own modifications
|
37
33
|
* Have questions? Check out our official forum community [Jekyll Talk](https://talk.jekyllrb.com/) or [`#jekyll` on irc.freenode.net](https://botbot.me/freenode/jekyll/)
|
38
34
|
|
35
|
+
## Diving In
|
36
|
+
|
37
|
+
* [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
|
38
|
+
* Learn how [Front Matter](https://jekyllrb.com/docs/front-matter/) works
|
39
|
+
* Put information on your site with [Variables](https://jekyllrb.com/docs/variables/)
|
40
|
+
* Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with
|
41
|
+
* Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier
|
42
|
+
* Use custom [Plugins](https://jekyllrb.com/docs/plugins/) to generate content specific to your site
|
43
|
+
* Watch [video tutorials from Giraffe Academy](https://jekyllrb.com/tutorials/video-walkthroughs/)
|
44
|
+
|
45
|
+
## Need help?
|
46
|
+
|
47
|
+
If you don't find the answer to your problem in our [docs](https://jekyllrb.com/docs/), or in the [troubleshooting section](https://jekyllrb.com/docs/troubleshooting/), ask the [community](https://jekyllrb.com/docs/community/) for help.
|
48
|
+
|
39
49
|
## Code of Conduct
|
40
50
|
|
41
51
|
In order to have a more open and welcoming community, Jekyll adheres to a
|
@@ -45,16 +55,35 @@ conduct.
|
|
45
55
|
Please adhere to this code of conduct in any interactions you have in the
|
46
56
|
Jekyll community. It is strictly enforced on all official Jekyll
|
47
57
|
repositories, websites, and resources. If you encounter someone violating
|
48
|
-
these terms, please let one of our core team members
|
58
|
+
these terms, please let one of our [core team members](https://jekyllrb.com/team/#core-team) know and we will address it as soon as possible.
|
49
59
|
|
50
|
-
##
|
60
|
+
## Credits
|
51
61
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
62
|
+
### Sponsors
|
63
|
+
|
64
|
+
Support this project by becoming a sponsor. Your logo will show up in this README with a link to your website. [Become a sponsor!](https://opencollective.com/jekyll#sponsor)
|
65
|
+
|
66
|
+
<a href="https://opencollective.com/jekyll/sponsor/0/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/0/avatar.svg" /></a>
|
67
|
+
<a href="https://opencollective.com/jekyll/sponsor/1/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/1/avatar.svg" /></a>
|
68
|
+
<a href="https://opencollective.com/jekyll/sponsor/2/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/2/avatar.svg" /></a>
|
69
|
+
<a href="https://opencollective.com/jekyll/sponsor/3/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/3/avatar.svg" /></a>
|
70
|
+
<a href="https://opencollective.com/jekyll/sponsor/4/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/4/avatar.svg" /></a>
|
71
|
+
<a href="https://opencollective.com/jekyll/sponsor/5/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/5/avatar.svg" /></a>
|
72
|
+
<a href="https://opencollective.com/jekyll/sponsor/6/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/6/avatar.svg" /></a>
|
73
|
+
<a href="https://opencollective.com/jekyll/sponsor/7/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/7/avatar.svg" /></a>
|
74
|
+
<a href="https://opencollective.com/jekyll/sponsor/8/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/8/avatar.svg" /></a>
|
75
|
+
<a href="https://opencollective.com/jekyll/sponsor/9/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/9/avatar.svg" /></a>
|
76
|
+
|
77
|
+
### Contributors
|
78
|
+
|
79
|
+
This project exists thanks to all the people who contribute.
|
80
|
+
<a href="../../graphs/contributors"><img src="https://opencollective.com/jekyll/contributors.svg?width=890&button=false" /></a>
|
81
|
+
|
82
|
+
### Backers
|
83
|
+
|
84
|
+
Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/jekyll#backer)
|
85
|
+
|
86
|
+
<a href="https://opencollective.com/jekyll#backers" target="_blank"><img src="https://opencollective.com/jekyll/backers.svg?width=890" /></a>
|
58
87
|
|
59
88
|
## License
|
60
89
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="{{ site.lang | default: "en-US" }}">
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<title>{{ page.title }} - {{ site.title }}</title>
|
7
|
+
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
{{ content}}
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
$backgroundColor: #ffffff;
|
2
|
+
$bodyColor: #000000;
|
3
|
+
$bodyFont: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
|
4
|
+
|
5
|
+
body {
|
6
|
+
background: $backgroundColor;
|
7
|
+
color: $bodyColor;
|
8
|
+
font-family: $bodyFont;
|
9
|
+
}
|
data/lib/jekyll.rb
CHANGED
@@ -50,10 +50,13 @@ module Jekyll
|
|
50
50
|
autoload :EntryFilter, "jekyll/entry_filter"
|
51
51
|
autoload :Errors, "jekyll/errors"
|
52
52
|
autoload :Excerpt, "jekyll/excerpt"
|
53
|
+
autoload :PageExcerpt, "jekyll/page_excerpt"
|
53
54
|
autoload :External, "jekyll/external"
|
54
55
|
autoload :FrontmatterDefaults, "jekyll/frontmatter_defaults"
|
55
56
|
autoload :Hooks, "jekyll/hooks"
|
56
57
|
autoload :Layout, "jekyll/layout"
|
58
|
+
autoload :Inclusion, "jekyll/inclusion"
|
59
|
+
autoload :Cache, "jekyll/cache"
|
57
60
|
autoload :CollectionReader, "jekyll/readers/collection_reader"
|
58
61
|
autoload :DataReader, "jekyll/readers/data_reader"
|
59
62
|
autoload :LayoutReader, "jekyll/readers/layout_reader"
|
@@ -64,8 +67,10 @@ module Jekyll
|
|
64
67
|
autoload :LogAdapter, "jekyll/log_adapter"
|
65
68
|
autoload :Page, "jekyll/page"
|
66
69
|
autoload :PageWithoutAFile, "jekyll/page_without_a_file"
|
70
|
+
autoload :PathManager, "jekyll/path_manager"
|
67
71
|
autoload :PluginManager, "jekyll/plugin_manager"
|
68
72
|
autoload :Publisher, "jekyll/publisher"
|
73
|
+
autoload :Profiler, "jekyll/profiler"
|
69
74
|
autoload :Reader, "jekyll/reader"
|
70
75
|
autoload :Regenerator, "jekyll/regenerator"
|
71
76
|
autoload :RelatedPosts, "jekyll/related_posts"
|
@@ -175,6 +180,10 @@ module Jekyll
|
|
175
180
|
|
176
181
|
return clean_path if clean_path.eql?(base_directory)
|
177
182
|
|
183
|
+
# remove any remaining extra leading slashes not stripped away by calling
|
184
|
+
# `File.expand_path` above.
|
185
|
+
clean_path.squeeze!("/")
|
186
|
+
|
178
187
|
if clean_path.start_with?(base_directory.sub(%r!\z!, "/"))
|
179
188
|
clean_path
|
180
189
|
else
|
@@ -184,7 +193,7 @@ module Jekyll
|
|
184
193
|
end
|
185
194
|
|
186
195
|
# Conditional optimizations
|
187
|
-
Jekyll::External.require_if_present("liquid
|
196
|
+
Jekyll::External.require_if_present("liquid/c")
|
188
197
|
end
|
189
198
|
end
|
190
199
|
|
data/lib/jekyll/cache.rb
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "digest"
|
4
|
+
|
5
|
+
module Jekyll
|
6
|
+
class Cache
|
7
|
+
# class-wide base cache
|
8
|
+
@base_cache = {}
|
9
|
+
|
10
|
+
# class-wide directive to write cache to disk is enabled by default
|
11
|
+
@disk_cache_enabled = true
|
12
|
+
|
13
|
+
class << self
|
14
|
+
# class-wide cache location
|
15
|
+
attr_accessor :cache_dir
|
16
|
+
|
17
|
+
# class-wide directive to write cache to disk
|
18
|
+
attr_reader :disk_cache_enabled
|
19
|
+
|
20
|
+
# class-wide base cache reader
|
21
|
+
attr_reader :base_cache
|
22
|
+
|
23
|
+
# Disable Marshaling cached items to disk
|
24
|
+
def disable_disk_cache!
|
25
|
+
@disk_cache_enabled = false
|
26
|
+
end
|
27
|
+
|
28
|
+
# Clear all caches
|
29
|
+
def clear
|
30
|
+
delete_cache_files
|
31
|
+
base_cache.each_value(&:clear)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Compare the current config to the cached config
|
35
|
+
# If they are different, clear all caches
|
36
|
+
#
|
37
|
+
# Returns nothing.
|
38
|
+
def clear_if_config_changed(config)
|
39
|
+
config = config.inspect
|
40
|
+
cache = Jekyll::Cache.new "Jekyll::Cache"
|
41
|
+
return if cache.key?("config") && cache["config"] == config
|
42
|
+
|
43
|
+
clear
|
44
|
+
cache = Jekyll::Cache.new "Jekyll::Cache"
|
45
|
+
cache["config"] = config
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
# Delete all cached items from all caches
|
52
|
+
#
|
53
|
+
# Returns nothing.
|
54
|
+
def delete_cache_files
|
55
|
+
FileUtils.rm_rf(@cache_dir) if disk_cache_enabled
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
|
61
|
+
# Get an existing named cache, or create a new one if none exists
|
62
|
+
#
|
63
|
+
# name - name of the cache
|
64
|
+
#
|
65
|
+
# Returns nothing.
|
66
|
+
def initialize(name)
|
67
|
+
@cache = Jekyll::Cache.base_cache[name] ||= {}
|
68
|
+
@name = name.gsub(%r![^\w\s-]!, "-")
|
69
|
+
end
|
70
|
+
|
71
|
+
# Clear this particular cache
|
72
|
+
def clear
|
73
|
+
delete_cache_files
|
74
|
+
@cache.clear
|
75
|
+
end
|
76
|
+
|
77
|
+
# Retrieve a cached item
|
78
|
+
# Raises if key does not exist in cache
|
79
|
+
#
|
80
|
+
# Returns cached value
|
81
|
+
def [](key)
|
82
|
+
return @cache[key] if @cache.key?(key)
|
83
|
+
|
84
|
+
path = path_to(hash(key))
|
85
|
+
if disk_cache_enabled? && File.file?(path) && File.readable?(path)
|
86
|
+
@cache[key] = load(path)
|
87
|
+
else
|
88
|
+
raise
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Add an item to cache
|
93
|
+
#
|
94
|
+
# Returns nothing.
|
95
|
+
def []=(key, value)
|
96
|
+
@cache[key] = value
|
97
|
+
return unless disk_cache_enabled?
|
98
|
+
|
99
|
+
path = path_to(hash(key))
|
100
|
+
value = new Hash(value) if value.is_a?(Hash) && !value.default.nil?
|
101
|
+
dump(path, value)
|
102
|
+
rescue TypeError
|
103
|
+
Jekyll.logger.debug "Cache:", "Cannot dump object #{key}"
|
104
|
+
end
|
105
|
+
|
106
|
+
# If an item already exists in the cache, retrieve it.
|
107
|
+
# Else execute code block, and add the result to the cache, and return that result.
|
108
|
+
def getset(key)
|
109
|
+
self[key]
|
110
|
+
rescue StandardError
|
111
|
+
value = yield
|
112
|
+
self[key] = value
|
113
|
+
value
|
114
|
+
end
|
115
|
+
|
116
|
+
# Remove one particular item from the cache
|
117
|
+
#
|
118
|
+
# Returns nothing.
|
119
|
+
def delete(key)
|
120
|
+
@cache.delete(key)
|
121
|
+
File.delete(path_to(hash(key))) if disk_cache_enabled?
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check if `key` already exists in this cache
|
125
|
+
#
|
126
|
+
# Returns true if key exists in the cache, false otherwise
|
127
|
+
def key?(key)
|
128
|
+
# First, check if item is already cached in memory
|
129
|
+
return true if @cache.key?(key)
|
130
|
+
# Otherwise, it might be cached on disk
|
131
|
+
# but we should not consider the disk cache if it is disabled
|
132
|
+
return false unless disk_cache_enabled?
|
133
|
+
|
134
|
+
path = path_to(hash(key))
|
135
|
+
File.file?(path) && File.readable?(path)
|
136
|
+
end
|
137
|
+
|
138
|
+
def disk_cache_enabled?
|
139
|
+
!!Jekyll::Cache.disk_cache_enabled
|
140
|
+
end
|
141
|
+
|
142
|
+
private
|
143
|
+
|
144
|
+
# Given a hashed key, return the path to where this item would be saved on disk.
|
145
|
+
def path_to(hash = nil)
|
146
|
+
@base_dir ||= File.join(Jekyll::Cache.cache_dir, @name)
|
147
|
+
return @base_dir if hash.nil?
|
148
|
+
|
149
|
+
File.join(@base_dir, hash[0..1], hash[2..-1]).freeze
|
150
|
+
end
|
151
|
+
|
152
|
+
# Given a key, return a SHA2 hash that can be used for caching this item to disk.
|
153
|
+
def hash(key)
|
154
|
+
Digest::SHA2.hexdigest(key).freeze
|
155
|
+
end
|
156
|
+
|
157
|
+
# Remove all this caches items from disk
|
158
|
+
#
|
159
|
+
# Returns nothing.
|
160
|
+
def delete_cache_files
|
161
|
+
FileUtils.rm_rf(path_to) if disk_cache_enabled?
|
162
|
+
end
|
163
|
+
|
164
|
+
# Load `path` from disk and return the result.
|
165
|
+
# This MUST NEVER be called in Safe Mode
|
166
|
+
# rubocop:disable Security/MarshalLoad
|
167
|
+
def load(path)
|
168
|
+
raise unless disk_cache_enabled?
|
169
|
+
|
170
|
+
cached_file = File.open(path, "rb")
|
171
|
+
value = Marshal.load(cached_file)
|
172
|
+
cached_file.close
|
173
|
+
value
|
174
|
+
end
|
175
|
+
# rubocop:enable Security/MarshalLoad
|
176
|
+
|
177
|
+
# Given a path and a value, save value to disk at path.
|
178
|
+
# This should NEVER be called in Safe Mode
|
179
|
+
#
|
180
|
+
# Returns nothing.
|
181
|
+
def dump(path, value)
|
182
|
+
return unless disk_cache_enabled?
|
183
|
+
|
184
|
+
FileUtils.mkdir_p(File.dirname(path))
|
185
|
+
File.open(path, "wb") do |cached_file|
|
186
|
+
Marshal.dump(value, cached_file)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|