jekyll 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/jekyll.rb +0 -1
- data/lib/jekyll/collection.rb +18 -3
- data/lib/jekyll/command.rb +0 -25
- data/lib/jekyll/commands/build.rb +7 -2
- data/lib/jekyll/commands/help.rb +33 -0
- data/lib/jekyll/configuration.rb +36 -28
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/jekyll/convertible.rb +43 -20
- data/lib/jekyll/deprecator.rb +15 -8
- data/lib/jekyll/document.rb +21 -4
- data/lib/jekyll/filters.rb +27 -1
- data/lib/jekyll/frontmatter_defaults.rb +46 -12
- data/lib/jekyll/plugin.rb +10 -1
- data/lib/jekyll/post.rb +6 -13
- data/lib/jekyll/related_posts.rb +2 -2
- data/lib/jekyll/renderer.rb +7 -2
- data/lib/jekyll/site.rb +5 -7
- data/lib/jekyll/static_file.rb +24 -4
- data/lib/jekyll/tags/include.rb +3 -1
- data/lib/jekyll/tags/post_url.rb +2 -2
- data/lib/jekyll/utils.rb +88 -69
- data/lib/jekyll/version.rb +1 -1
- data/lib/site_template/_config.yml +6 -4
- data/lib/site_template/_includes/footer.html +43 -49
- data/lib/site_template/_includes/head.html +3 -4
- data/lib/site_template/_includes/header.html +9 -10
- data/lib/site_template/_layouts/default.html +6 -5
- data/lib/site_template/_layouts/page.html +3 -3
- data/lib/site_template/_layouts/post.html +4 -4
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +6 -5
- data/lib/site_template/_sass/_base.scss +203 -0
- data/lib/site_template/_sass/_layout.scss +236 -0
- data/lib/site_template/_sass/_syntax-highlighting.scss +67 -0
- data/lib/site_template/css/main.scss +49 -0
- data/lib/site_template/feed.xml +1 -1
- data/lib/site_template/index.html +7 -4
- metadata +24 -431
- data/.gitignore +0 -15
- data/.travis.yml +0 -27
- data/CONTRIBUTING.markdown +0 -91
- data/Gemfile +0 -2
- data/History.markdown +0 -1310
- data/Rakefile +0 -268
- data/cucumber.yml +0 -3
- data/docs/jp/CONTRIBUTING.jp.markdown +0 -93
- data/docs/jp/README.jp.markdown +0 -68
- data/features/collections.feature +0 -145
- data/features/create_sites.feature +0 -158
- data/features/data.feature +0 -105
- data/features/drafts.feature +0 -46
- data/features/embed_filters.feature +0 -107
- data/features/frontmatter_defaults.feature +0 -136
- data/features/include_tag.feature +0 -68
- data/features/markdown.feature +0 -67
- data/features/pagination.feature +0 -82
- data/features/permalinks.feature +0 -85
- data/features/post_data.feature +0 -261
- data/features/post_excerpts.feature +0 -50
- data/features/rendering.feature +0 -34
- data/features/site_configuration.feature +0 -283
- data/features/site_data.feature +0 -107
- data/features/step_definitions/jekyll_steps.rb +0 -201
- data/features/support/env.rb +0 -65
- data/jekyll.gemspec +0 -66
- data/lib/site_template/css/main.css +0 -410
- data/script/bootstrap +0 -4
- data/script/branding +0 -11
- data/script/cibuild +0 -7
- data/script/console +0 -38
- data/script/proof +0 -22
- data/script/rebund +0 -140
- data/script/test +0 -17
- data/site/.gitignore +0 -4
- data/site/CNAME +0 -1
- data/site/README +0 -1
- data/site/_config.yml +0 -9
- data/site/_data/docs.yml +0 -46
- data/site/_includes/analytics.html +0 -30
- data/site/_includes/anchor_links.html +0 -32
- data/site/_includes/css/font-awesome.css +0 -44
- data/site/_includes/css/gridism.css +0 -110
- data/site/_includes/css/normalize.css +0 -1
- data/site/_includes/css/pygments.css +0 -72
- data/site/_includes/css/style.css +0 -1045
- data/site/_includes/docs_contents.html +0 -8
- data/site/_includes/docs_contents_mobile.html +0 -10
- data/site/_includes/docs_option.html +0 -11
- data/site/_includes/docs_ul.html +0 -20
- data/site/_includes/footer.html +0 -15
- data/site/_includes/header.html +0 -18
- data/site/_includes/news_contents.html +0 -33
- data/site/_includes/news_contents_mobile.html +0 -11
- data/site/_includes/news_item.html +0 -24
- data/site/_includes/primary-nav-items.html +0 -17
- data/site/_includes/section_nav.html +0 -22
- data/site/_includes/top.html +0 -17
- data/site/_layouts/default.html +0 -13
- data/site/_layouts/docs.html +0 -23
- data/site/_layouts/news.html +0 -19
- data/site/_layouts/news_item.html +0 -27
- data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +0 -23
- data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +0 -27
- data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +0 -28
- data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +0 -25
- data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +0 -27
- data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +0 -31
- data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +0 -20
- data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +0 -20
- data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +0 -23
- data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +0 -19
- data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
- data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
- data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
- data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
- data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +0 -20
- data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
- data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -26
- data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +0 -19
- data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +0 -26
- data/site/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +0 -31
- data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +0 -18
- data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +0 -19
- data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +0 -31
- data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +0 -30
- data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +0 -19
- data/site/css/screen.css +0 -31
- data/site/docs/assets.md +0 -66
- data/site/docs/collections.md +0 -259
- data/site/docs/configuration.md +0 -536
- data/site/docs/continuous-integration.md +0 -177
- data/site/docs/contributing.md +0 -133
- data/site/docs/datafiles.md +0 -108
- data/site/docs/deployment-methods.md +0 -127
- data/site/docs/drafts.md +0 -21
- data/site/docs/extras.md +0 -18
- data/site/docs/frontmatter.md +0 -191
- data/site/docs/github-pages.md +0 -91
- data/site/docs/history.md +0 -1514
- data/site/docs/index.md +0 -58
- data/site/docs/installation.md +0 -106
- data/site/docs/migrations.md +0 -11
- data/site/docs/pages.md +0 -86
- data/site/docs/pagination.md +0 -212
- data/site/docs/permalinks.md +0 -188
- data/site/docs/plugins.md +0 -561
- data/site/docs/posts.md +0 -211
- data/site/docs/quickstart.md +0 -26
- data/site/docs/resources.md +0 -43
- data/site/docs/sites.md +0 -29
- data/site/docs/structure.md +0 -190
- data/site/docs/templates.md +0 -376
- data/site/docs/troubleshooting.md +0 -147
- data/site/docs/upgrading.md +0 -146
- data/site/docs/usage.md +0 -74
- data/site/docs/variables.md +0 -382
- data/site/docs/windows.md +0 -44
- data/site/favicon.ico +0 -0
- data/site/feed.xml +0 -48
- data/site/fonts/FontAwesome.otf +0 -0
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +0 -504
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/freenode.txt +0 -1
- 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/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 -90
- data/site/js/html5shiv.min.js +0 -4
- data/site/js/respond.min.js +0 -5
- data/site/news/index.html +0 -10
- data/site/news/releases/index.html +0 -10
- data/test/fixtures/broken_front_matter1.erb +0 -5
- data/test/fixtures/broken_front_matter2.erb +0 -4
- data/test/fixtures/broken_front_matter3.erb +0 -7
- data/test/fixtures/exploit_front_matter.erb +0 -4
- data/test/fixtures/front_matter.erb +0 -4
- data/test/helper.rb +0 -80
- data/test/source/+/%# +.md +0 -6
- data/test/source/+/foo.md +0 -7
- data/test/source/.htaccess +0 -8
- data/test/source/_config.dev.toml +0 -2
- data/test/source/_data/categories/dairy.yaml +0 -6
- data/test/source/_data/languages.yml +0 -2
- data/test/source/_data/members.json +0 -12
- data/test/source/_data/members.yaml +0 -7
- data/test/source/_data/products.yml +0 -4
- data/test/source/_drafts/draft-properties.text +0 -11
- data/test/source/_includes/include.html +0 -1
- data/test/source/_includes/params.html +0 -7
- data/test/source/_includes/sig.markdown +0 -3
- data/test/source/_layouts/default.html +0 -27
- data/test/source/_layouts/post/simple.html +0 -1
- data/test/source/_layouts/simple.html +0 -1
- data/test/source/_methods/_do_not_read_me.md +0 -5
- data/test/source/_methods/configuration.md +0 -8
- data/test/source/_methods/sanitized_path.md +0 -5
- data/test/source/_methods/site/_dont_include_me_either.md +0 -5
- data/test/source/_methods/site/generate.md +0 -6
- data/test/source/_methods/site/initialize.md +0 -4
- data/test/source/_methods/um_hi.md +0 -6
- data/test/source/_plugins/dummy.rb +0 -8
- data/test/source/_posts/2008-02-02-not-published.textile +0 -8
- data/test/source/_posts/2008-02-02-published.textile +0 -8
- data/test/source/_posts/2008-10-18-foo-bar.textile +0 -8
- data/test/source/_posts/2008-11-21-complex.textile +0 -8
- data/test/source/_posts/2008-12-03-permalinked-post.textile +0 -9
- data/test/source/_posts/2008-12-13-include.markdown +0 -8
- data/test/source/_posts/2009-01-27-array-categories.textile +0 -10
- data/test/source/_posts/2009-01-27-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-category.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-categories.textile +0 -7
- data/test/source/_posts/2009-01-27-empty-category.textile +0 -7
- data/test/source/_posts/2009-01-27-no-category.textile +0 -6
- data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
- data/test/source/_posts/2009-05-18-empty-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-empty-tags.textile +0 -6
- data/test/source/_posts/2009-05-18-tag.textile +0 -6
- data/test/source/_posts/2009-05-18-tags.textile +0 -9
- data/test/source/_posts/2009-06-22-empty-yaml.textile +0 -3
- data/test/source/_posts/2009-06-22-no-yaml.textile +0 -1
- data/test/source/_posts/2010-01-08-triple-dash.markdown +0 -5
- data/test/source/_posts/2010-01-09-date-override.textile +0 -7
- data/test/source/_posts/2010-01-09-time-override.textile +0 -7
- data/test/source/_posts/2010-01-09-timezone-override.textile +0 -7
- data/test/source/_posts/2010-01-16-override-data.textile +0 -4
- data/test/source/_posts/2011-04-12-md-extension.md +0 -7
- data/test/source/_posts/2011-04-12-text-extension.text +0 -0
- data/test/source/_posts/2013-01-02-post-excerpt.markdown +0 -14
- data/test/source/_posts/2013-01-12-nil-layout.textile +0 -6
- data/test/source/_posts/2013-01-12-no-layout.textile +0 -5
- data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
- data/test/source/_posts/2013-04-11-custom-excerpt.markdown +0 -10
- data/test/source/_posts/2013-05-10-number-category.textile +0 -7
- data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +0 -23
- data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
- data/test/source/_posts/2013-12-17-include-variable-filters.markdown +0 -21
- data/test/source/_posts/2013-12-20-properties.text +0 -11
- data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
- data/test/source/_posts/2014-03-03-yaml-with-dots.md +0 -5
- data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +0 -6
- data/test/source/_posts/es/2008-11-21-nested.textile +0 -8
- data/test/source/_sass/_grid.scss +0 -1
- data/test/source/_slides/example-slide-1.html +0 -4
- data/test/source/_slides/example-slide-2.html +0 -7
- data/test/source/_slides/example-slide-3.html +0 -5
- data/test/source/_with.dots/all.dots/2.4.0.md +0 -5
- data/test/source/_with.dots/file.with.dots.md +0 -0
- data/test/source/about.html +0 -6
- data/test/source/category/_posts/2008-9-23-categories.textile +0 -6
- data/test/source/contacts.html +0 -5
- data/test/source/contacts/bar.html +0 -5
- data/test/source/contacts/index.html +0 -5
- data/test/source/css/main.scss +0 -4
- data/test/source/css/screen.css +0 -76
- data/test/source/deal.with.dots.html +0 -7
- data/test/source/environment.html +0 -5
- data/test/source/exploit.md +0 -5
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +0 -8
- data/test/source/index.html +0 -22
- data/test/source/js/coffeescript.coffee +0 -10
- data/test/source/pgp.key +0 -2
- data/test/source/products.yml +0 -4
- data/test/source/properties.html +0 -8
- data/test/source/sitemap.xml +0 -32
- data/test/source/static_files.html +0 -4
- data/test/source/symlink-test/symlinked-file +0 -22
- data/test/source/unpublished.html +0 -7
- data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +0 -7
- data/test/source/z_category/_posts/2008-9-23-categories.textile +0 -6
- data/test/suite.rb +0 -11
- data/test/test_cleaner.rb +0 -77
- data/test/test_coffeescript.rb +0 -49
- data/test/test_collections.rb +0 -224
- data/test/test_command.rb +0 -53
- data/test/test_configuration.rb +0 -201
- data/test/test_convertible.rb +0 -49
- data/test/test_document.rb +0 -193
- data/test/test_draft.rb +0 -56
- data/test/test_entry_filter.rb +0 -124
- data/test/test_excerpt.rb +0 -131
- data/test/test_filters.rb +0 -207
- data/test/test_generated_site.rb +0 -97
- data/test/test_kramdown.rb +0 -62
- data/test/test_layout_reader.rb +0 -34
- data/test/test_liquid_extensions.rb +0 -31
- data/test/test_log_adapter.rb +0 -59
- data/test/test_new_command.rb +0 -104
- data/test/test_page.rb +0 -254
- data/test/test_path_sanitization.rb +0 -18
- data/test/test_post.rb +0 -741
- data/test/test_rdiscount.rb +0 -22
- data/test/test_redcarpet.rb +0 -77
- data/test/test_redcloth.rb +0 -86
- data/test/test_related_posts.rb +0 -47
- data/test/test_sass.rb +0 -26
- data/test/test_site.rb +0 -452
- data/test/test_tags.rb +0 -509
- data/test/test_url.rb +0 -28
- data/test/test_utils.rb +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bd7e49f4d0c08e3a671d21444bc80a53ef6c4a0
|
4
|
+
data.tar.gz: 8eec4bc8581b8abd01c7bf077b79980af61537b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6688a5be7d34576575ec1098fe5f80c2f625c6a4eefa5869bcb64a9ce41fe8d5c05424c9105fbcdc88f44512fa663aafd458da75e0672b1bd97b328c42af65a0
|
7
|
+
data.tar.gz: 0ce421c5435ad40f8cf231e38891a6949a827a75964b7c2c426654f2746507ed1f77a1cba06be22f709bc77cd7949a81cedf6510c629d3ee463fb41d957cefde
|
data/README.markdown
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Code Climate](http://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
|
6
6
|
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
|
7
7
|
|
8
|
-
By Tom Preston-Werner, Nick Quaranto, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
8
|
+
By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
|
9
9
|
|
10
10
|
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](http://pages.github.com), which you can use to host sites right from your GitHub repositories.
|
11
11
|
|
data/lib/jekyll.rb
CHANGED
data/lib/jekyll/collection.rb
CHANGED
@@ -22,14 +22,28 @@ module Jekyll
|
|
22
22
|
@docs ||= []
|
23
23
|
end
|
24
24
|
|
25
|
+
# Fetch the static files in this collection.
|
26
|
+
# Defaults to an empty array if no static files have been read in.
|
27
|
+
#
|
28
|
+
# Returns an array of Jekyll::StaticFile objects.
|
29
|
+
def files
|
30
|
+
@files ||= []
|
31
|
+
end
|
32
|
+
|
25
33
|
# Read the allowed documents into the collection's array of docs.
|
26
34
|
#
|
27
35
|
# Returns the sorted array of docs.
|
28
36
|
def read
|
29
37
|
filtered_entries.each do |file_path|
|
30
|
-
|
31
|
-
|
32
|
-
|
38
|
+
full_path = Jekyll.sanitized_path(directory, file_path)
|
39
|
+
if Utils.has_yaml_header? full_path
|
40
|
+
doc = Jekyll::Document.new(full_path, { site: site, collection: self })
|
41
|
+
doc.read
|
42
|
+
docs << doc
|
43
|
+
else
|
44
|
+
relative_dir = File.join(relative_directory, File.dirname(file_path)).chomp("/.")
|
45
|
+
files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
|
46
|
+
end
|
33
47
|
end
|
34
48
|
docs.sort!
|
35
49
|
end
|
@@ -118,6 +132,7 @@ module Jekyll
|
|
118
132
|
metadata.merge({
|
119
133
|
"label" => label,
|
120
134
|
"docs" => docs,
|
135
|
+
"files" => files,
|
121
136
|
"directory" => directory,
|
122
137
|
"output" => write?,
|
123
138
|
"relative_directory" => relative_directory
|
data/lib/jekyll/command.rb
CHANGED
@@ -19,31 +19,6 @@ module Jekyll
|
|
19
19
|
super(base)
|
20
20
|
end
|
21
21
|
|
22
|
-
# Paths to ignore for the watch option
|
23
|
-
#
|
24
|
-
# options - A Hash of options passed to the command
|
25
|
-
#
|
26
|
-
# Returns a list of relative paths from source that should be ignored
|
27
|
-
def ignore_paths(options)
|
28
|
-
source = options['source']
|
29
|
-
destination = options['destination']
|
30
|
-
config_files = Configuration[options].config_files(options)
|
31
|
-
paths = config_files + Array(destination)
|
32
|
-
ignored = []
|
33
|
-
|
34
|
-
source_abs = Pathname.new(source).expand_path
|
35
|
-
paths.each do |p|
|
36
|
-
path_abs = Pathname.new(p).expand_path
|
37
|
-
begin
|
38
|
-
rel_path = path_abs.relative_path_from(source_abs).to_s
|
39
|
-
ignored << Regexp.new(Regexp.escape(rel_path)) unless rel_path.start_with?('../')
|
40
|
-
rescue ArgumentError
|
41
|
-
# Could not find a relative path
|
42
|
-
end
|
43
|
-
end
|
44
|
-
ignored
|
45
|
-
end
|
46
|
-
|
47
22
|
# Run Site#process and catch errors
|
48
23
|
#
|
49
24
|
# site - the Jekyll::Site object
|
@@ -32,7 +32,12 @@ module Jekyll
|
|
32
32
|
else
|
33
33
|
build(site, options)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
|
+
if options.fetch('watch', false)
|
37
|
+
watch(site, options)
|
38
|
+
else
|
39
|
+
Jekyll.logger.info "Auto-regeneration:", "disabled. Use --watch to enable."
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
# Build your Jekyll site.
|
@@ -59,7 +64,7 @@ module Jekyll
|
|
59
64
|
# Returns nothing.
|
60
65
|
def watch(site, options)
|
61
66
|
Deprecator.gracefully_require 'jekyll-watch'
|
62
|
-
Jekyll::
|
67
|
+
Jekyll::Watcher.watch(options)
|
63
68
|
end
|
64
69
|
|
65
70
|
end # end of class << self
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Commands
|
3
|
+
class Help < Command
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def init_with_program(prog)
|
7
|
+
prog.command(:help) do |c|
|
8
|
+
c.syntax 'help [subcommand]'
|
9
|
+
c.description 'Show the help message, optionally for a given subcommand.'
|
10
|
+
|
11
|
+
c.action do |args, _|
|
12
|
+
cmd = (args.first || "").to_sym
|
13
|
+
if args.empty?
|
14
|
+
puts prog
|
15
|
+
elsif prog.has_command? cmd
|
16
|
+
puts prog.commands[cmd]
|
17
|
+
else
|
18
|
+
invalid_command(prog, cmd)
|
19
|
+
abort
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def invalid_command(prog, cmd)
|
26
|
+
Jekyll.logger.error "Error:", "Hmm... we don't know what the '#{cmd}' command is."
|
27
|
+
Jekyll.logger.info "Valid commands:", prog.commands.keys.join(", ")
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/jekyll/configuration.rb
CHANGED
@@ -6,47 +6,55 @@ module Jekyll
|
|
6
6
|
# Default options. Overridden by values in _config.yml.
|
7
7
|
# Strings rather than symbols are used for compatibility with YAML.
|
8
8
|
DEFAULTS = {
|
9
|
+
# Where things are
|
9
10
|
'source' => Dir.pwd,
|
10
11
|
'destination' => File.join(Dir.pwd, '_site'),
|
11
12
|
'plugins' => '_plugins',
|
12
13
|
'layouts' => '_layouts',
|
13
14
|
'data_source' => '_data',
|
14
|
-
'keep_files' => ['.git','.svn'],
|
15
|
-
'gems' => [],
|
16
15
|
'collections' => nil,
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
'encoding' => 'utf-8', # always use utf-8 encoding. NEVER FORGET
|
21
|
-
|
17
|
+
# Handling Reading
|
22
18
|
'safe' => false,
|
23
|
-
'
|
19
|
+
'include' => ['.htaccess'],
|
20
|
+
'exclude' => [],
|
21
|
+
'keep_files' => ['.git','.svn'],
|
22
|
+
'encoding' => 'utf-8',
|
23
|
+
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
|
24
|
+
'textile_ext' => 'textile',
|
25
|
+
|
26
|
+
# Filtering Content
|
24
27
|
'show_drafts' => nil,
|
25
28
|
'limit_posts' => 0,
|
26
|
-
'lsi' => false,
|
27
29
|
'future' => true, # remove and make true just default
|
28
30
|
'unpublished' => false,
|
29
31
|
|
30
|
-
|
32
|
+
# Plugins
|
33
|
+
'whitelist' => [],
|
34
|
+
'gems' => [],
|
31
35
|
|
36
|
+
# Conversion
|
32
37
|
'markdown' => 'kramdown',
|
33
38
|
'highlighter' => 'pygments',
|
34
|
-
'
|
35
|
-
'
|
36
|
-
'include' => ['.htaccess'],
|
37
|
-
'exclude' => [],
|
38
|
-
'paginate_path' => '/page:num',
|
39
|
-
|
40
|
-
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
|
41
|
-
'textile_ext' => 'textile',
|
39
|
+
'lsi' => false,
|
40
|
+
'excerpt_separator' => "\n\n",
|
42
41
|
|
43
|
-
|
42
|
+
# Serving
|
43
|
+
'detach' => false, # default to not detaching the server
|
44
44
|
'port' => '4000',
|
45
45
|
'host' => '0.0.0.0',
|
46
|
+
'baseurl' => '',
|
46
47
|
|
47
|
-
|
48
|
+
# Backwards-compatibility options
|
49
|
+
'relative_permalinks' => false,
|
50
|
+
|
51
|
+
# Output Configuration
|
52
|
+
'permalink' => 'date',
|
53
|
+
'paginate_path' => '/page:num',
|
54
|
+
'timezone' => nil, # use the local timezone
|
48
55
|
|
49
|
-
'
|
56
|
+
'quiet' => false,
|
57
|
+
'defaults' => [],
|
50
58
|
|
51
59
|
'maruku' => {
|
52
60
|
'use_tex' => false,
|
@@ -110,9 +118,9 @@ module Jekyll
|
|
110
118
|
|
111
119
|
def safe_load_file(filename)
|
112
120
|
case File.extname(filename)
|
113
|
-
when
|
121
|
+
when /\.toml/i
|
114
122
|
TOML.load_file(filename)
|
115
|
-
when /\.
|
123
|
+
when /\.ya?ml/i
|
116
124
|
SafeYAML.load_file(filename)
|
117
125
|
else
|
118
126
|
raise ArgumentError, "No parser for '#{filename}' is available. Use a .toml or .y(a)ml file instead."
|
@@ -200,7 +208,7 @@ module Jekyll
|
|
200
208
|
def backwards_compatibilize
|
201
209
|
config = clone
|
202
210
|
# Provide backwards-compatibility
|
203
|
-
if config.
|
211
|
+
if config.key?('auto') || config.key?('watch')
|
204
212
|
Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" +
|
205
213
|
" be set from your configuration file(s). Use the"+
|
206
214
|
" --watch/-w command-line option instead."
|
@@ -208,23 +216,23 @@ module Jekyll
|
|
208
216
|
config.delete('watch')
|
209
217
|
end
|
210
218
|
|
211
|
-
if config.
|
219
|
+
if config.key? 'server'
|
212
220
|
Jekyll.logger.warn "Deprecation:", "The 'server' configuration option" +
|
213
221
|
" is no longer accepted. Use the 'jekyll serve'" +
|
214
222
|
" subcommand to serve your site with WEBrick."
|
215
223
|
config.delete('server')
|
216
224
|
end
|
217
225
|
|
218
|
-
if config.
|
226
|
+
if config.key? 'server_port'
|
219
227
|
Jekyll.logger.warn "Deprecation:", "The 'server_port' configuration option" +
|
220
228
|
" has been renamed to 'port'. Please update your config" +
|
221
229
|
" file accordingly."
|
222
230
|
# copy but don't overwrite:
|
223
|
-
config['port'] = config['server_port'] unless config.
|
231
|
+
config['port'] = config['server_port'] unless config.key?('port')
|
224
232
|
config.delete('server_port')
|
225
233
|
end
|
226
234
|
|
227
|
-
if config.
|
235
|
+
if config.key? 'pygments'
|
228
236
|
Jekyll.logger.warn "Deprecation:", "The 'pygments' configuration option" +
|
229
237
|
" has been renamed to 'highlighter'. Please update your" +
|
230
238
|
" config file accordingly. The allowed values are 'rouge', " +
|
@@ -256,7 +264,7 @@ module Jekyll
|
|
256
264
|
def fix_common_issues
|
257
265
|
config = clone
|
258
266
|
|
259
|
-
if config.
|
267
|
+
if config.key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 1)
|
260
268
|
Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" +
|
261
269
|
" positive integer or nil. It's currently set to '#{config['paginate'].inspect}'."
|
262
270
|
config['paginate'] = nil
|
@@ -16,7 +16,7 @@ module Jekyll
|
|
16
16
|
if @config['kramdown']['use_coderay']
|
17
17
|
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
|
18
18
|
key = "coderay_#{opt}"
|
19
|
-
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].
|
19
|
+
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -25,7 +25,7 @@ module Jekyll
|
|
25
25
|
|
26
26
|
# Whether the file is published or not, as indicated in YAML front-matter
|
27
27
|
def published?
|
28
|
-
!(data.
|
28
|
+
!(data.key?('published') && data['published'] == false)
|
29
29
|
end
|
30
30
|
|
31
31
|
# Returns merged option hash for File.read of self.site (if exists)
|
@@ -62,11 +62,14 @@ module Jekyll
|
|
62
62
|
#
|
63
63
|
# Returns nothing.
|
64
64
|
def transform
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
converters.reduce(content) do |output, converter|
|
66
|
+
begin
|
67
|
+
converter.convert output
|
68
|
+
rescue => e
|
69
|
+
Jekyll.logger.error "Conversion error:", "#{converter.class} encountered an error converting '#{path}'."
|
70
|
+
raise e
|
71
|
+
end
|
72
|
+
end
|
70
73
|
end
|
71
74
|
|
72
75
|
# Determine the extension depending on content_type.
|
@@ -74,15 +77,21 @@ module Jekyll
|
|
74
77
|
# Returns the String extension for the output file.
|
75
78
|
# e.g. ".html" for an HTML output file.
|
76
79
|
def output_ext
|
77
|
-
|
80
|
+
if converters.all? { |c| c.is_a?(Jekyll::Converters::Identity) }
|
81
|
+
ext
|
82
|
+
else
|
83
|
+
converters.map { |c|
|
84
|
+
c.output_ext(ext) unless c.is_a?(Jekyll::Converters::Identity)
|
85
|
+
}.compact.last
|
86
|
+
end
|
78
87
|
end
|
79
88
|
|
80
89
|
# Determine which converter to use based on this convertible's
|
81
90
|
# extension.
|
82
91
|
#
|
83
92
|
# Returns the Converter instance.
|
84
|
-
def
|
85
|
-
@
|
93
|
+
def converters
|
94
|
+
@converters ||= site.converters.select { |c| c.matches(ext) }.sort
|
86
95
|
end
|
87
96
|
|
88
97
|
# Render Liquid in the content
|
@@ -119,12 +128,12 @@ module Jekyll
|
|
119
128
|
#
|
120
129
|
# Returns the type of self.
|
121
130
|
def type
|
122
|
-
if is_a?(
|
123
|
-
:
|
131
|
+
if is_a?(Draft)
|
132
|
+
:drafts
|
133
|
+
elsif is_a?(Post)
|
134
|
+
:posts
|
124
135
|
elsif is_a?(Page)
|
125
|
-
:
|
126
|
-
elsif is_a?(Draft)
|
127
|
-
:draft
|
136
|
+
:pages
|
128
137
|
end
|
129
138
|
end
|
130
139
|
|
@@ -134,7 +143,21 @@ module Jekyll
|
|
134
143
|
# Returns true if the extname belongs to the set of extensions
|
135
144
|
# that asset files use.
|
136
145
|
def asset_file?
|
137
|
-
|
146
|
+
sass_file? || coffeescript_file?
|
147
|
+
end
|
148
|
+
|
149
|
+
# Determine whether the document is a Sass file.
|
150
|
+
#
|
151
|
+
# Returns true if extname == .sass or .scss, false otherwise.
|
152
|
+
def sass_file?
|
153
|
+
%w[.sass .scss].include?(ext)
|
154
|
+
end
|
155
|
+
|
156
|
+
# Determine whether the document is a CoffeeScript file.
|
157
|
+
#
|
158
|
+
# Returns true if extname == .coffee, false otherwise.
|
159
|
+
def coffeescript_file?
|
160
|
+
'.coffee'.eql?(ext)
|
138
161
|
end
|
139
162
|
|
140
163
|
# Determine whether the file should be rendered with Liquid.
|
@@ -142,7 +165,7 @@ module Jekyll
|
|
142
165
|
# Returns false if the document is either an asset file or a yaml file,
|
143
166
|
# true otherwise.
|
144
167
|
def render_with_liquid?
|
145
|
-
!
|
168
|
+
!coffeescript_file?
|
146
169
|
end
|
147
170
|
|
148
171
|
# Determine whether the file should be placed into layouts.
|
@@ -159,7 +182,7 @@ module Jekyll
|
|
159
182
|
#
|
160
183
|
# Returns true if the layout is invalid, false if otherwise
|
161
184
|
def invalid_layout?(layout)
|
162
|
-
!data["layout"].nil? &&
|
185
|
+
!data["layout"].nil? && layout.nil? && !(self.is_a? Jekyll::Excerpt)
|
163
186
|
end
|
164
187
|
|
165
188
|
# Recursively render layouts
|
@@ -205,11 +228,11 @@ module Jekyll
|
|
205
228
|
info = { :filters => [Jekyll::Filters], :registers => { :site => site, :page => payload['page'] } }
|
206
229
|
|
207
230
|
# render and transform content (this becomes the final content of the object)
|
208
|
-
payload["highlighter_prefix"] =
|
209
|
-
payload["highlighter_suffix"] =
|
231
|
+
payload["highlighter_prefix"] = converters.first.highlighter_prefix
|
232
|
+
payload["highlighter_suffix"] = converters.first.highlighter_suffix
|
210
233
|
|
211
234
|
self.content = render_liquid(content, payload, info) if render_with_liquid?
|
212
|
-
transform
|
235
|
+
self.content = transform
|
213
236
|
|
214
237
|
# output keeps track of what will finally be written
|
215
238
|
self.output = content
|
data/lib/jekyll/deprecator.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Jekyll
|
2
2
|
module Deprecator
|
3
|
-
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def process(args)
|
4
6
|
no_subcommand(args)
|
5
7
|
arg_is_present? args, "--server", "The --server command has been replaced by the \
|
6
8
|
'serve' subcommand."
|
@@ -16,36 +18,41 @@ module Jekyll
|
|
16
18
|
arg_is_present? args, "--url", "The 'url' setting can only be set in your config files."
|
17
19
|
end
|
18
20
|
|
19
|
-
def
|
21
|
+
def no_subcommand(args)
|
20
22
|
if args.size > 0 && args.first =~ /^--/ && !%w[--help --version].include?(args.first)
|
21
|
-
|
23
|
+
deprecation_message "Jekyll now uses subcommands instead of just \
|
22
24
|
switches. Run `jekyll --help' to find out more."
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
|
-
def
|
28
|
+
def arg_is_present?(args, deprecated_argument, message)
|
27
29
|
if args.include?(deprecated_argument)
|
28
30
|
deprecation_message(message)
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
|
-
def
|
34
|
+
def deprecation_message(message)
|
33
35
|
Jekyll.logger.error "Deprecation:", message
|
34
36
|
end
|
35
37
|
|
36
|
-
def
|
38
|
+
def defaults_deprecate_type(old, current)
|
39
|
+
Jekyll.logger.warn "Defaults:", "The '#{old}' type has become '#{current}'."
|
40
|
+
Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'."
|
41
|
+
end
|
42
|
+
|
43
|
+
def gracefully_require(gem_name)
|
37
44
|
Array(gem_name).each do |name|
|
38
45
|
begin
|
39
46
|
require name
|
40
47
|
rescue LoadError => e
|
41
48
|
Jekyll.logger.error "Dependency Error:", <<-MSG
|
42
49
|
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
|
43
|
-
In order to use Jekyll as currently
|
50
|
+
In order to use Jekyll as currently configured, you'll need to install this gem.
|
44
51
|
|
45
52
|
The full error message from Ruby is: '#{e.message}'
|
46
53
|
|
47
54
|
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
|
48
|
-
|
55
|
+
MSG
|
49
56
|
raise Errors::MissingDependencyException.new(name)
|
50
57
|
end
|
51
58
|
end
|