jekyll-docs 3.6.1.0 → 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll.rb +195 -0
- data/lib/jekyll/cleaner.rb +110 -0
- data/lib/jekyll/collection.rb +230 -0
- data/lib/jekyll/command.rb +78 -0
- data/lib/jekyll/commands/build.rb +102 -0
- data/lib/jekyll/commands/clean.rb +43 -0
- data/lib/jekyll/commands/doctor.rb +153 -0
- data/lib/jekyll/commands/help.rb +34 -0
- data/lib/jekyll/commands/new.rb +156 -0
- data/lib/jekyll/commands/new_theme.rb +40 -0
- data/lib/jekyll/commands/serve.rb +245 -0
- data/lib/jekyll/commands/serve/servlet.rb +62 -0
- data/lib/jekyll/configuration.rb +410 -0
- data/lib/jekyll/converter.rb +54 -0
- data/lib/jekyll/converters/identity.rb +23 -0
- data/lib/jekyll/converters/markdown.rb +104 -0
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +123 -0
- data/lib/jekyll/converters/markdown/rdiscount_parser.rb +35 -0
- data/lib/jekyll/converters/markdown/redcarpet_parser.rb +108 -0
- data/lib/jekyll/converters/smartypants.rb +36 -0
- data/lib/jekyll/convertible.rb +251 -0
- data/lib/jekyll/deprecator.rb +52 -0
- data/lib/jekyll/document.rb +507 -0
- data/lib/jekyll/drops/collection_drop.rb +22 -0
- data/lib/jekyll/drops/document_drop.rb +69 -0
- data/lib/jekyll/drops/drop.rb +214 -0
- data/lib/jekyll/drops/excerpt_drop.rb +15 -0
- data/lib/jekyll/drops/jekyll_drop.rb +33 -0
- data/lib/jekyll/drops/site_drop.rb +47 -0
- data/lib/jekyll/drops/static_file_drop.rb +13 -0
- data/lib/jekyll/drops/unified_payload_drop.rb +25 -0
- data/lib/jekyll/drops/url_drop.rb +88 -0
- data/lib/jekyll/entry_filter.rb +123 -0
- data/lib/jekyll/errors.rb +20 -0
- data/lib/jekyll/excerpt.rb +126 -0
- data/lib/jekyll/external.rb +74 -0
- data/lib/jekyll/filters.rb +430 -0
- data/lib/jekyll/filters/grouping_filters.rb +65 -0
- data/lib/jekyll/filters/url_filters.rb +60 -0
- data/lib/jekyll/frontmatter_defaults.rb +197 -0
- data/lib/jekyll/generator.rb +5 -0
- data/lib/jekyll/hooks.rb +104 -0
- data/lib/jekyll/layout.rb +62 -0
- data/lib/jekyll/liquid_extensions.rb +24 -0
- data/lib/jekyll/liquid_renderer.rb +49 -0
- data/lib/jekyll/liquid_renderer/file.rb +56 -0
- data/lib/jekyll/liquid_renderer/table.rb +96 -0
- data/lib/jekyll/log_adapter.rb +147 -0
- data/lib/jekyll/mime.types +825 -0
- data/lib/jekyll/page.rb +187 -0
- data/lib/jekyll/plugin.rb +98 -0
- data/lib/jekyll/plugin_manager.rb +113 -0
- data/lib/jekyll/publisher.rb +23 -0
- data/lib/jekyll/reader.rb +134 -0
- data/lib/jekyll/readers/collection_reader.rb +22 -0
- data/lib/jekyll/readers/data_reader.rb +77 -0
- data/lib/jekyll/readers/layout_reader.rb +71 -0
- data/lib/jekyll/readers/page_reader.rb +25 -0
- data/lib/jekyll/readers/post_reader.rb +72 -0
- data/lib/jekyll/readers/static_file_reader.rb +25 -0
- data/lib/jekyll/readers/theme_assets_reader.rb +49 -0
- data/lib/jekyll/regenerator.rb +201 -0
- data/lib/jekyll/related_posts.rb +52 -0
- data/lib/jekyll/renderer.rb +269 -0
- data/lib/jekyll/site.rb +472 -0
- data/lib/jekyll/static_file.rb +162 -0
- data/lib/jekyll/stevenson.rb +61 -0
- data/lib/jekyll/tags/highlight.rb +141 -0
- data/lib/jekyll/tags/include.rb +215 -0
- data/lib/jekyll/tags/link.rb +37 -0
- data/lib/jekyll/tags/post_url.rb +103 -0
- data/lib/jekyll/theme.rb +68 -0
- data/lib/jekyll/theme_builder.rb +119 -0
- data/lib/jekyll/url.rb +161 -0
- data/lib/jekyll/utils.rb +340 -0
- data/lib/jekyll/utils/ansi.rb +59 -0
- data/lib/jekyll/utils/exec.rb +27 -0
- data/lib/jekyll/utils/platforms.rb +82 -0
- data/lib/jekyll/utils/rouge.rb +21 -0
- data/lib/jekyll/utils/win_tz.rb +75 -0
- data/lib/jekyll/version.rb +5 -0
- data/lib/site_template/404.html +24 -0
- data/lib/site_template/_config.yml +43 -0
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +25 -0
- data/lib/site_template/about.md +18 -0
- data/lib/site_template/index.md +6 -0
- data/lib/theme_template/CODE_OF_CONDUCT.md.erb +74 -0
- data/lib/theme_template/Gemfile +4 -0
- data/lib/theme_template/LICENSE.txt.erb +21 -0
- data/lib/theme_template/README.md.erb +52 -0
- data/lib/theme_template/_layouts/default.html +1 -0
- data/lib/theme_template/_layouts/page.html +5 -0
- data/lib/theme_template/_layouts/post.html +5 -0
- data/lib/theme_template/example/_config.yml.erb +1 -0
- data/lib/theme_template/example/_post.md +12 -0
- data/lib/theme_template/example/index.html +14 -0
- data/lib/theme_template/example/style.scss +7 -0
- data/lib/theme_template/gitignore.erb +5 -0
- data/lib/theme_template/theme.gemspec.erb +19 -0
- metadata +103 -156
- data/lib/jekyll-docs.rb +0 -31
- data/site/404.html +0 -153
- data/site/CNAME +0 -1
- data/site/community/index.html +0 -299
- data/site/conduct/index.html +0 -10
- data/site/css/screen.css +0 -1
- data/site/docs/assets/index.html +0 -724
- data/site/docs/code_of_conduct/index.html +0 -730
- data/site/docs/collections/index.html +0 -1097
- data/site/docs/conduct/index.html +0 -744
- data/site/docs/configuration/index.html +0 -1403
- data/site/docs/continuous-integration/buddyworks/index.html +0 -726
- data/site/docs/continuous-integration/circleci/index.html +0 -757
- data/site/docs/continuous-integration/index.html +0 -681
- data/site/docs/continuous-integration/travis-ci/index.html +0 -891
- data/site/docs/contributing/index.html +0 -863
- data/site/docs/datafiles/index.html +0 -780
- data/site/docs/deployment-methods/index.html +0 -875
- data/site/docs/drafts/index.html +0 -636
- data/site/docs/extras/index.html +0 -689
- data/site/docs/frontmatter/index.html +0 -821
- data/site/docs/github-pages/index.html +0 -819
- data/site/docs/history/index.html +0 -3955
- data/site/docs/home/index.html +0 -644
- data/site/docs/includes/index.html +0 -800
- data/site/docs/index.html +0 -10
- data/site/docs/installation/index.html +0 -732
- data/site/docs/maintaining/affinity-team-captain/index.html +0 -706
- data/site/docs/maintaining/avoiding-burnout/index.html +0 -709
- data/site/docs/maintaining/becoming-a-maintainer/index.html +0 -717
- data/site/docs/maintaining/index.html +0 -713
- data/site/docs/maintaining/merging-a-pull-request/index.html +0 -747
- data/site/docs/maintaining/reviewing-a-pull-request/index.html +0 -725
- data/site/docs/maintaining/special-labels/index.html +0 -705
- data/site/docs/maintaining/triaging-an-issue/index.html +0 -735
- data/site/docs/migrations/index.html +0 -647
- data/site/docs/pages/index.html +0 -695
- data/site/docs/pagination/index.html +0 -870
- data/site/docs/permalinks/index.html +0 -1035
- data/site/docs/plugins/index.html +0 -1800
- data/site/docs/posts/index.html +0 -858
- data/site/docs/quickstart/index.html +0 -650
- data/site/docs/resources/index.html +0 -769
- data/site/docs/sites/index.html +0 -702
- data/site/docs/static-files/index.html +0 -720
- data/site/docs/structure/index.html +0 -822
- data/site/docs/templates/index.html +0 -1208
- data/site/docs/themes/index.html +0 -935
- data/site/docs/troubleshooting/index.html +0 -916
- data/site/docs/upgrading/0-to-2/index.html +0 -826
- data/site/docs/upgrading/2-to-3/index.html +0 -824
- data/site/docs/upgrading/index.html +0 -693
- data/site/docs/usage/index.html +0 -705
- data/site/docs/variables/index.html +0 -1048
- data/site/docs/windows/index.html +0 -799
- data/site/favicon.ico +0 -0
- data/site/feed.xml +0 -372
- data/site/fonts/FontAwesome.eot +0 -0
- data/site/fonts/FontAwesome.svg +0 -12
- data/site/fonts/FontAwesome.ttf +0 -0
- data/site/fonts/FontAwesome.woff +0 -0
- data/site/github.html +0 -10
- data/site/help/index.html +0 -244
- data/site/icomoon-selection.json +0 -96
- data/site/img/article-footer.png +0 -0
- data/site/img/footer-arrow.png +0 -0
- data/site/img/footer-logo.png +0 -0
- data/site/img/jekyll-sticker.jpg +0 -0
- data/site/img/jekylllayoutconcept.png +0 -0
- data/site/img/logo-2x.png +0 -0
- data/site/img/logo-rss.png +0 -0
- data/site/img/octojekyll.png +0 -0
- data/site/index.html +0 -267
- data/site/issues.html +0 -10
- data/site/js/html5shiv.min.js +0 -4
- data/site/js/respond.min.js +0 -5
- data/site/latest_version.txt +0 -1
- data/site/news/2013/05/05/jekyll-1-0-0-released/index.html +0 -570
- data/site/news/2013/05/08/jekyll-1-0-1-released/index.html +0 -570
- data/site/news/2013/05/12/jekyll-1-0-2-released/index.html +0 -571
- data/site/news/2013/06/07/jekyll-1-0-3-released/index.html +0 -568
- data/site/news/2013/07/14/jekyll-1-1-0-released/index.html +0 -570
- data/site/news/2013/07/24/jekyll-1-1-1-released/index.html +0 -569
- data/site/news/2013/07/25/jekyll-1-0-4-released/index.html +0 -565
- data/site/news/2013/07/25/jekyll-1-1-2-released/index.html +0 -565
- data/site/news/2013/09/06/jekyll-1-2-0-released/index.html +0 -572
- data/site/news/2013/09/14/jekyll-1-2-1-released/index.html +0 -566
- data/site/news/2013/10/28/jekyll-1-3-0-rc1-released/index.html +0 -564
- data/site/news/2013/11/04/jekyll-1-3-0-released/index.html +0 -599
- data/site/news/2013/11/26/jekyll-1-3-1-released/index.html +0 -568
- data/site/news/2013/12/07/jekyll-1-4-0-released/index.html +0 -583
- data/site/news/2013/12/09/jekyll-1-4-1-released/index.html +0 -565
- data/site/news/2013/12/16/jekyll-1-4-2-released/index.html +0 -564
- data/site/news/2014/01/13/jekyll-1-4-3-released/index.html +0 -573
- data/site/news/2014/03/24/jekyll-1-5-0-released/index.html +0 -564
- data/site/news/2014/03/27/jekyll-1-5-1-released/index.html +0 -569
- data/site/news/2014/05/06/jekyll-turns-2-0-0/index.html +0 -585
- data/site/news/2014/05/08/jekyll-2-0-3-released/index.html +0 -565
- data/site/news/2014/06/04/jekyll-stickers-1-dollar-stickermule/index.html +0 -567
- data/site/news/2014/06/28/jekyll-turns-21-i-mean-2-1-0/index.html +0 -582
- data/site/news/2014/07/01/jekyll-2-1-1-released/index.html +0 -579
- data/site/news/2014/07/29/jekyll-2-2-0-released/index.html +0 -568
- data/site/news/2014/08/10/jekyll-2-3-0-released/index.html +0 -588
- data/site/news/2014/09/09/jekyll-2-4-0-released/index.html +0 -574
- data/site/news/2014/11/05/jekylls-midlife-crisis-jekyll-turns-2-5-0/index.html +0 -597
- data/site/news/2014/11/09/jekyll-2-5-1-released/index.html +0 -575
- data/site/news/2014/11/12/jekyll-2-5-2-released/index.html +0 -565
- data/site/news/2014/12/17/alfredxing-welcome-to-jekyll-core/index.html +0 -572
- data/site/news/2014/12/22/jekyll-2-5-3-released/index.html +0 -567
- data/site/news/2015/01/20/jekyll-meet-and-greet/index.html +0 -568
- data/site/news/2015/01/24/jekyll-3-0-0-beta1-released/index.html +0 -588
- data/site/news/2015/02/26/introducing-jekyll-talk/index.html +0 -563
- data/site/news/2015/10/26/jekyll-3-0-released/index.html +0 -592
- data/site/news/2015/11/17/jekyll-3-0-1-released/index.html +0 -576
- data/site/news/2016/01/20/jekyll-3-0-2-released/index.html +0 -566
- data/site/news/2016/01/24/jekyll-3-1-0-released/index.html +0 -599
- data/site/news/2016/01/28/jekyll-3-1-1-released/index.html +0 -583
- data/site/news/2016/02/08/jekyll-3-0-3-released/index.html +0 -578
- data/site/news/2016/02/19/jekyll-3-1-2-released/index.html +0 -569
- data/site/news/2016/03/10/making-it-easier-to-contribute-to-jekyll/index.html +0 -565
- data/site/news/2016/04/19/jekyll-3-0-4-released/index.html +0 -571
- data/site/news/2016/04/19/jekyll-3-1-3-released/index.html +0 -566
- data/site/news/2016/04/26/jekyll-3-0-5-released/index.html +0 -572
- data/site/news/2016/05/18/jekyll-3-1-4-released/index.html +0 -576
- data/site/news/2016/05/18/jekyll-3-1-5-released/index.html +0 -564
- data/site/news/2016/05/19/jekyll-3-1-6-released/index.html +0 -566
- data/site/news/2016/06/03/update-on-jekyll-s-google-summer-of-code-projects/index.html +0 -567
- data/site/news/2016/07/26/jekyll-3-2-0-released/index.html +0 -676
- data/site/news/2016/08/02/jekyll-3-2-1-released/index.html +0 -571
- data/site/news/2016/08/24/jekyll-admin-initial-release/index.html +0 -566
- data/site/news/2016/10/06/jekyll-3-3-is-here/index.html +0 -645
- data/site/news/2016/11/14/jekyll-3-3-1-released/index.html +0 -569
- data/site/news/2017/01/18/jekyll-3-4-0-released/index.html +0 -592
- data/site/news/2017/03/02/jekyll-3-4-1-released/index.html +0 -649
- data/site/news/2017/03/09/jekyll-3-4-2-released/index.html +0 -598
- data/site/news/2017/03/21/jekyll-3-4-3-released/index.html +0 -594
- data/site/news/2017/06/15/jekyll-3-5-0-released/index.html +0 -589
- data/site/news/2017/07/17/jekyll-3-5-1-released/index.html +0 -569
- data/site/news/2017/08/12/jekyll-3-5-2-released/index.html +0 -573
- data/site/news/2017/09/21/jekyll-3-6-0-released/index.html +0 -565
- data/site/news/index.html +0 -3609
- data/site/news/releases/index.html +0 -3344
- data/site/philosophy.html +0 -46
- data/site/readme.md +0 -23
- data/site/robots.txt +0 -1
- data/site/sitemap.xml +0 -485
- data/site/tutorials/convert-site-to-jekyll/index.html +0 -793
- data/site/tutorials/custom-404-page/index.html +0 -358
- data/site/tutorials/home/index.html +0 -323
- data/site/tutorials/index.html +0 -10
- data/site/tutorials/navigation/index.html +0 -872
- data/site/tutorials/orderofinterpretation/index.html +0 -441
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a30cc678a463ff549ca37b2b2bc65d717c94e1
|
4
|
+
data.tar.gz: e98ca466aaf32659ff2150eac3816ede049e2f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3efc0d85fe31a000110dc44881f8417523f0d545785d79244d303b76f23af7faa9692a638057cba235a36866dc45f0083fd0cf23f6389f898b259270d472b442
|
7
|
+
data.tar.gz: 7ea57c8549eb092477ec495d98e15245d31797c21a445abf7100603f6bfd171227ecdf5583bd2744824cd0ab714c6b17792ea53045fa039d5ef8e94b28d533cc
|
data/lib/jekyll.rb
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift __dir__ # For use/testing when no gem is installed
|
4
|
+
|
5
|
+
# Require all of the Ruby files in the given directory.
|
6
|
+
#
|
7
|
+
# path - The String relative path from here to the directory.
|
8
|
+
#
|
9
|
+
# Returns nothing.
|
10
|
+
def require_all(path)
|
11
|
+
glob = File.join(__dir__, path, "*.rb")
|
12
|
+
Dir[glob].sort.each do |f|
|
13
|
+
require f
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# rubygems
|
18
|
+
require "rubygems"
|
19
|
+
|
20
|
+
# stdlib
|
21
|
+
require "pathutil"
|
22
|
+
require "forwardable"
|
23
|
+
require "fileutils"
|
24
|
+
require "time"
|
25
|
+
require "English"
|
26
|
+
require "pathname"
|
27
|
+
require "logger"
|
28
|
+
require "set"
|
29
|
+
|
30
|
+
# 3rd party
|
31
|
+
require "safe_yaml/load"
|
32
|
+
require "liquid"
|
33
|
+
require "kramdown"
|
34
|
+
require "colorator"
|
35
|
+
|
36
|
+
SafeYAML::OPTIONS[:suppress_warnings] = true
|
37
|
+
|
38
|
+
module Jekyll
|
39
|
+
# internal requires
|
40
|
+
autoload :Cleaner, "jekyll/cleaner"
|
41
|
+
autoload :Collection, "jekyll/collection"
|
42
|
+
autoload :Configuration, "jekyll/configuration"
|
43
|
+
autoload :Convertible, "jekyll/convertible"
|
44
|
+
autoload :Deprecator, "jekyll/deprecator"
|
45
|
+
autoload :Document, "jekyll/document"
|
46
|
+
autoload :EntryFilter, "jekyll/entry_filter"
|
47
|
+
autoload :Errors, "jekyll/errors"
|
48
|
+
autoload :Excerpt, "jekyll/excerpt"
|
49
|
+
autoload :External, "jekyll/external"
|
50
|
+
autoload :FrontmatterDefaults, "jekyll/frontmatter_defaults"
|
51
|
+
autoload :Hooks, "jekyll/hooks"
|
52
|
+
autoload :Layout, "jekyll/layout"
|
53
|
+
autoload :CollectionReader, "jekyll/readers/collection_reader"
|
54
|
+
autoload :DataReader, "jekyll/readers/data_reader"
|
55
|
+
autoload :LayoutReader, "jekyll/readers/layout_reader"
|
56
|
+
autoload :PostReader, "jekyll/readers/post_reader"
|
57
|
+
autoload :PageReader, "jekyll/readers/page_reader"
|
58
|
+
autoload :StaticFileReader, "jekyll/readers/static_file_reader"
|
59
|
+
autoload :ThemeAssetsReader, "jekyll/readers/theme_assets_reader"
|
60
|
+
autoload :LogAdapter, "jekyll/log_adapter"
|
61
|
+
autoload :Page, "jekyll/page"
|
62
|
+
autoload :PluginManager, "jekyll/plugin_manager"
|
63
|
+
autoload :Publisher, "jekyll/publisher"
|
64
|
+
autoload :Reader, "jekyll/reader"
|
65
|
+
autoload :Regenerator, "jekyll/regenerator"
|
66
|
+
autoload :RelatedPosts, "jekyll/related_posts"
|
67
|
+
autoload :Renderer, "jekyll/renderer"
|
68
|
+
autoload :LiquidRenderer, "jekyll/liquid_renderer"
|
69
|
+
autoload :Site, "jekyll/site"
|
70
|
+
autoload :StaticFile, "jekyll/static_file"
|
71
|
+
autoload :Stevenson, "jekyll/stevenson"
|
72
|
+
autoload :Theme, "jekyll/theme"
|
73
|
+
autoload :ThemeBuilder, "jekyll/theme_builder"
|
74
|
+
autoload :URL, "jekyll/url"
|
75
|
+
autoload :Utils, "jekyll/utils"
|
76
|
+
autoload :VERSION, "jekyll/version"
|
77
|
+
|
78
|
+
# extensions
|
79
|
+
require "jekyll/plugin"
|
80
|
+
require "jekyll/converter"
|
81
|
+
require "jekyll/generator"
|
82
|
+
require "jekyll/command"
|
83
|
+
require "jekyll/liquid_extensions"
|
84
|
+
require "jekyll/filters"
|
85
|
+
|
86
|
+
class << self
|
87
|
+
# Public: Tells you which Jekyll environment you are building in so you can skip tasks
|
88
|
+
# if you need to. This is useful when doing expensive compression tasks on css and
|
89
|
+
# images and allows you to skip that when working in development.
|
90
|
+
|
91
|
+
def env
|
92
|
+
ENV["JEKYLL_ENV"] || "development"
|
93
|
+
end
|
94
|
+
|
95
|
+
# Public: Generate a Jekyll configuration Hash by merging the default
|
96
|
+
# options with anything in _config.yml, and adding the given options on top.
|
97
|
+
#
|
98
|
+
# override - A Hash of config directives that override any options in both
|
99
|
+
# the defaults and the config file.
|
100
|
+
# See Jekyll::Configuration::DEFAULTS for a
|
101
|
+
# list of option names and their defaults.
|
102
|
+
#
|
103
|
+
# Returns the final configuration Hash.
|
104
|
+
def configuration(override = {})
|
105
|
+
config = Configuration.new
|
106
|
+
override = Configuration[override].stringify_keys
|
107
|
+
unless override.delete("skip_config_files")
|
108
|
+
config = config.read_config_files(config.config_files(override))
|
109
|
+
end
|
110
|
+
|
111
|
+
# Merge DEFAULTS < _config.yml < override
|
112
|
+
Configuration.from(Utils.deep_merge_hashes(config, override)).tap do |obj|
|
113
|
+
set_timezone(obj["timezone"]) if obj["timezone"]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Public: Set the TZ environment variable to use the timezone specified
|
118
|
+
#
|
119
|
+
# timezone - the IANA Time Zone
|
120
|
+
#
|
121
|
+
# Returns nothing
|
122
|
+
# rubocop:disable Naming/AccessorMethodName
|
123
|
+
def set_timezone(timezone)
|
124
|
+
ENV["TZ"] = if Utils::Platforms.really_windows?
|
125
|
+
Utils::WinTZ.calculate(timezone)
|
126
|
+
else
|
127
|
+
timezone
|
128
|
+
end
|
129
|
+
end
|
130
|
+
# rubocop:enable Naming/AccessorMethodName
|
131
|
+
|
132
|
+
# Public: Fetch the logger instance for this Jekyll process.
|
133
|
+
#
|
134
|
+
# Returns the LogAdapter instance.
|
135
|
+
def logger
|
136
|
+
@logger ||= LogAdapter.new(Stevenson.new, (ENV["JEKYLL_LOG_LEVEL"] || :info).to_sym)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Public: Set the log writer.
|
140
|
+
# New log writer must respond to the same methods
|
141
|
+
# as Ruby's interal Logger.
|
142
|
+
#
|
143
|
+
# writer - the new Logger-compatible log transport
|
144
|
+
#
|
145
|
+
# Returns the new logger.
|
146
|
+
def logger=(writer)
|
147
|
+
@logger = LogAdapter.new(writer, (ENV["JEKYLL_LOG_LEVEL"] || :info).to_sym)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Public: An array of sites
|
151
|
+
#
|
152
|
+
# Returns the Jekyll sites created.
|
153
|
+
def sites
|
154
|
+
@sites ||= []
|
155
|
+
end
|
156
|
+
|
157
|
+
# Public: Ensures the questionable path is prefixed with the base directory
|
158
|
+
# and prepends the questionable path with the base directory if false.
|
159
|
+
#
|
160
|
+
# base_directory - the directory with which to prefix the questionable path
|
161
|
+
# questionable_path - the path we're unsure about, and want prefixed
|
162
|
+
#
|
163
|
+
# Returns the sanitized path.
|
164
|
+
def sanitized_path(base_directory, questionable_path)
|
165
|
+
return base_directory if base_directory.eql?(questionable_path)
|
166
|
+
|
167
|
+
clean_path = questionable_path.dup
|
168
|
+
clean_path.insert(0, "/") if clean_path.start_with?("~")
|
169
|
+
clean_path = File.expand_path(clean_path, "/")
|
170
|
+
|
171
|
+
return clean_path if clean_path.eql?(base_directory)
|
172
|
+
|
173
|
+
if clean_path.start_with?(base_directory.sub(%r!\z!, "/"))
|
174
|
+
clean_path
|
175
|
+
else
|
176
|
+
clean_path.sub!(%r!\A\w:/!, "/")
|
177
|
+
File.join(base_directory, clean_path)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Conditional optimizations
|
182
|
+
Jekyll::External.require_if_present("liquid-c")
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
require "jekyll/drops/drop"
|
187
|
+
require "jekyll/drops/document_drop"
|
188
|
+
require_all "jekyll/commands"
|
189
|
+
require_all "jekyll/converters"
|
190
|
+
require_all "jekyll/converters/markdown"
|
191
|
+
require_all "jekyll/drops"
|
192
|
+
require_all "jekyll/generators"
|
193
|
+
require_all "jekyll/tags"
|
194
|
+
|
195
|
+
require "jekyll-sass-converter"
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "set"
|
4
|
+
|
5
|
+
module Jekyll
|
6
|
+
# Handles the cleanup of a site's destination before it is built.
|
7
|
+
class Cleaner
|
8
|
+
HIDDEN_FILE_REGEX = %r!\/\.{1,2}$!
|
9
|
+
attr_reader :site
|
10
|
+
|
11
|
+
def initialize(site)
|
12
|
+
@site = site
|
13
|
+
end
|
14
|
+
|
15
|
+
# Cleans up the site's destination directory
|
16
|
+
def cleanup!
|
17
|
+
FileUtils.rm_rf(obsolete_files)
|
18
|
+
FileUtils.rm_rf(metadata_file) unless @site.incremental?
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# Private: The list of files and directories to be deleted during cleanup process
|
24
|
+
#
|
25
|
+
# Returns an Array of the file and directory paths
|
26
|
+
def obsolete_files
|
27
|
+
(existing_files - new_files - new_dirs + replaced_files).to_a
|
28
|
+
end
|
29
|
+
|
30
|
+
# Private: The metadata file storing dependency tree and build history
|
31
|
+
#
|
32
|
+
# Returns an Array with the metdata file as the only item
|
33
|
+
def metadata_file
|
34
|
+
[site.regenerator.metadata_file]
|
35
|
+
end
|
36
|
+
|
37
|
+
# Private: The list of existing files, apart from those included in
|
38
|
+
# keep_files and hidden files.
|
39
|
+
#
|
40
|
+
# Returns a Set with the file paths
|
41
|
+
def existing_files
|
42
|
+
files = Set.new
|
43
|
+
regex = keep_file_regex
|
44
|
+
dirs = keep_dirs
|
45
|
+
|
46
|
+
Utils.safe_glob(site.in_dest_dir, ["**", "*"], File::FNM_DOTMATCH).each do |file|
|
47
|
+
next if file =~ HIDDEN_FILE_REGEX || file =~ regex || dirs.include?(file)
|
48
|
+
files << file
|
49
|
+
end
|
50
|
+
|
51
|
+
files
|
52
|
+
end
|
53
|
+
|
54
|
+
# Private: The list of files to be created when site is built.
|
55
|
+
#
|
56
|
+
# Returns a Set with the file paths
|
57
|
+
def new_files
|
58
|
+
files = Set.new
|
59
|
+
site.each_site_file { |item| files << item.destination(site.dest) }
|
60
|
+
files
|
61
|
+
end
|
62
|
+
|
63
|
+
# Private: The list of directories to be created when site is built.
|
64
|
+
# These are the parent directories of the files in #new_files.
|
65
|
+
#
|
66
|
+
# Returns a Set with the directory paths
|
67
|
+
def new_dirs
|
68
|
+
new_files.map { |file| parent_dirs(file) }.flatten.to_set
|
69
|
+
end
|
70
|
+
|
71
|
+
# Private: The list of parent directories of a given file
|
72
|
+
#
|
73
|
+
# Returns an Array with the directory paths
|
74
|
+
def parent_dirs(file)
|
75
|
+
parent_dir = File.dirname(file)
|
76
|
+
if parent_dir == site.dest
|
77
|
+
[]
|
78
|
+
else
|
79
|
+
[parent_dir] + parent_dirs(parent_dir)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Private: The list of existing files that will be replaced by a directory
|
84
|
+
# during build
|
85
|
+
#
|
86
|
+
# Returns a Set with the file paths
|
87
|
+
def replaced_files
|
88
|
+
new_dirs.select { |dir| File.file?(dir) }.to_set
|
89
|
+
end
|
90
|
+
|
91
|
+
# Private: The list of directories that need to be kept because they are
|
92
|
+
# parent directories of files specified in keep_files
|
93
|
+
#
|
94
|
+
# Returns a Set with the directory paths
|
95
|
+
def keep_dirs
|
96
|
+
site.keep_files.map { |file| parent_dirs(site.in_dest_dir(file)) }.flatten.to_set
|
97
|
+
end
|
98
|
+
|
99
|
+
# Private: Creates a regular expression from the config's keep_files array
|
100
|
+
#
|
101
|
+
# Examples
|
102
|
+
# ['.git','.svn'] with site.dest "/myblog/_site" creates
|
103
|
+
# the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/
|
104
|
+
#
|
105
|
+
# Returns the regular expression
|
106
|
+
def keep_file_regex
|
107
|
+
%r!\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})!
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,230 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jekyll
|
4
|
+
class Collection
|
5
|
+
attr_reader :site, :label, :metadata
|
6
|
+
attr_writer :docs
|
7
|
+
|
8
|
+
# Create a new Collection.
|
9
|
+
#
|
10
|
+
# site - the site to which this collection belongs.
|
11
|
+
# label - the name of the collection
|
12
|
+
#
|
13
|
+
# Returns nothing.
|
14
|
+
def initialize(site, label)
|
15
|
+
@site = site
|
16
|
+
@label = sanitize_label(label)
|
17
|
+
@metadata = extract_metadata
|
18
|
+
end
|
19
|
+
|
20
|
+
# Fetch the Documents in this collection.
|
21
|
+
# Defaults to an empty array if no documents have been read in.
|
22
|
+
#
|
23
|
+
# Returns an array of Jekyll::Document objects.
|
24
|
+
def docs
|
25
|
+
@docs ||= []
|
26
|
+
end
|
27
|
+
|
28
|
+
# Override of normal respond_to? to match method_missing's logic for
|
29
|
+
# looking in @data.
|
30
|
+
def respond_to_missing?(method, include_private = false)
|
31
|
+
docs.respond_to?(method.to_sym, include_private) || super
|
32
|
+
end
|
33
|
+
|
34
|
+
# Override of method_missing to check in @data for the key.
|
35
|
+
def method_missing(method, *args, &blck)
|
36
|
+
if docs.respond_to?(method.to_sym)
|
37
|
+
Jekyll.logger.warn "Deprecation:",
|
38
|
+
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
|
39
|
+
Jekyll.logger.warn "", "Called by #{caller(0..0)}."
|
40
|
+
docs.public_send(method.to_sym, *args, &blck)
|
41
|
+
else
|
42
|
+
super
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Fetch the static files in this collection.
|
47
|
+
# Defaults to an empty array if no static files have been read in.
|
48
|
+
#
|
49
|
+
# Returns an array of Jekyll::StaticFile objects.
|
50
|
+
def files
|
51
|
+
@files ||= []
|
52
|
+
end
|
53
|
+
|
54
|
+
# Read the allowed documents into the collection's array of docs.
|
55
|
+
#
|
56
|
+
# Returns the sorted array of docs.
|
57
|
+
def read
|
58
|
+
filtered_entries.each do |file_path|
|
59
|
+
full_path = collection_dir(file_path)
|
60
|
+
next if File.directory?(full_path)
|
61
|
+
if Utils.has_yaml_header? full_path
|
62
|
+
read_document(full_path)
|
63
|
+
else
|
64
|
+
read_static_file(file_path, full_path)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
docs.sort!
|
68
|
+
end
|
69
|
+
|
70
|
+
# All the entries in this collection.
|
71
|
+
#
|
72
|
+
# Returns an Array of file paths to the documents in this collection
|
73
|
+
# relative to the collection's directory
|
74
|
+
def entries
|
75
|
+
return [] unless exists?
|
76
|
+
@entries ||=
|
77
|
+
Utils.safe_glob(collection_dir, ["**", "*"], File::FNM_DOTMATCH).map do |entry|
|
78
|
+
entry["#{collection_dir}/"] = ""
|
79
|
+
entry
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Filtered version of the entries in this collection.
|
84
|
+
# See `Jekyll::EntryFilter#filter` for more information.
|
85
|
+
#
|
86
|
+
# Returns a list of filtered entry paths.
|
87
|
+
def filtered_entries
|
88
|
+
return [] unless exists?
|
89
|
+
@filtered_entries ||=
|
90
|
+
Dir.chdir(directory) do
|
91
|
+
entry_filter.filter(entries).reject do |f|
|
92
|
+
path = collection_dir(f)
|
93
|
+
File.directory?(path) || entry_filter.symlink?(f)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# The directory for this Collection, relative to the site source.
|
99
|
+
#
|
100
|
+
# Returns a String containing the directory name where the collection
|
101
|
+
# is stored on the filesystem.
|
102
|
+
def relative_directory
|
103
|
+
@relative_directory ||= "_#{label}"
|
104
|
+
end
|
105
|
+
|
106
|
+
# The full path to the directory containing the collection.
|
107
|
+
#
|
108
|
+
# Returns a String containing th directory name where the collection
|
109
|
+
# is stored on the filesystem.
|
110
|
+
def directory
|
111
|
+
@directory ||= site.in_source_dir(relative_directory)
|
112
|
+
end
|
113
|
+
|
114
|
+
# The full path to the directory containing the collection, with
|
115
|
+
# optional subpaths.
|
116
|
+
#
|
117
|
+
# *files - (optional) any other path pieces relative to the
|
118
|
+
# directory to append to the path
|
119
|
+
#
|
120
|
+
# Returns a String containing th directory name where the collection
|
121
|
+
# is stored on the filesystem.
|
122
|
+
def collection_dir(*files)
|
123
|
+
return directory if files.empty?
|
124
|
+
site.in_source_dir(relative_directory, *files)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Checks whether the directory "exists" for this collection.
|
128
|
+
# The directory must exist on the filesystem and must not be a symlink
|
129
|
+
# if in safe mode.
|
130
|
+
#
|
131
|
+
# Returns false if the directory doesn't exist or if it's a symlink
|
132
|
+
# and we're in safe mode.
|
133
|
+
def exists?
|
134
|
+
File.directory?(directory) && !entry_filter.symlink?(directory)
|
135
|
+
end
|
136
|
+
|
137
|
+
# The entry filter for this collection.
|
138
|
+
# Creates an instance of Jekyll::EntryFilter.
|
139
|
+
#
|
140
|
+
# Returns the instance of Jekyll::EntryFilter for this collection.
|
141
|
+
def entry_filter
|
142
|
+
@entry_filter ||= Jekyll::EntryFilter.new(site, relative_directory)
|
143
|
+
end
|
144
|
+
|
145
|
+
# An inspect string.
|
146
|
+
#
|
147
|
+
# Returns the inspect string
|
148
|
+
def inspect
|
149
|
+
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
|
150
|
+
end
|
151
|
+
|
152
|
+
# Produce a sanitized label name
|
153
|
+
# Label names may not contain anything but alphanumeric characters,
|
154
|
+
# underscores, and hyphens.
|
155
|
+
#
|
156
|
+
# label - the possibly-unsafe label
|
157
|
+
#
|
158
|
+
# Returns a sanitized version of the label.
|
159
|
+
def sanitize_label(label)
|
160
|
+
label.gsub(%r![^a-z0-9_\-\.]!i, "")
|
161
|
+
end
|
162
|
+
|
163
|
+
# Produce a representation of this Collection for use in Liquid.
|
164
|
+
# Exposes two attributes:
|
165
|
+
# - label
|
166
|
+
# - docs
|
167
|
+
#
|
168
|
+
# Returns a representation of this collection for use in Liquid.
|
169
|
+
def to_liquid
|
170
|
+
Drops::CollectionDrop.new self
|
171
|
+
end
|
172
|
+
|
173
|
+
# Whether the collection's documents ought to be written as individual
|
174
|
+
# files in the output.
|
175
|
+
#
|
176
|
+
# Returns true if the 'write' metadata is true, false otherwise.
|
177
|
+
def write?
|
178
|
+
!!metadata.fetch("output", false)
|
179
|
+
end
|
180
|
+
|
181
|
+
# The URL template to render collection's documents at.
|
182
|
+
#
|
183
|
+
# Returns the URL template to render collection's documents at.
|
184
|
+
def url_template
|
185
|
+
@url_template ||= metadata.fetch("permalink") do
|
186
|
+
Utils.add_permalink_suffix("/:collection/:path", site.permalink_style)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Extract options for this collection from the site configuration.
|
191
|
+
#
|
192
|
+
# Returns the metadata for this collection
|
193
|
+
def extract_metadata
|
194
|
+
if site.config["collections"].is_a?(Hash)
|
195
|
+
site.config["collections"][label] || {}
|
196
|
+
else
|
197
|
+
{}
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
private
|
202
|
+
|
203
|
+
def read_document(full_path)
|
204
|
+
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
|
205
|
+
doc.read
|
206
|
+
if site.publisher.publish?(doc) || !write?
|
207
|
+
docs << doc
|
208
|
+
else
|
209
|
+
Jekyll.logger.debug "Skipped From Publishing:", doc.relative_path
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
private
|
214
|
+
|
215
|
+
def read_static_file(file_path, full_path)
|
216
|
+
relative_dir = Jekyll.sanitized_path(
|
217
|
+
relative_directory,
|
218
|
+
File.dirname(file_path)
|
219
|
+
).chomp("/.")
|
220
|
+
|
221
|
+
files << StaticFile.new(
|
222
|
+
site,
|
223
|
+
site.source,
|
224
|
+
relative_dir,
|
225
|
+
File.basename(full_path),
|
226
|
+
self
|
227
|
+
)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|