From 3768d90278a76bc7cd405ceed9d8b029c9efc489 Mon Sep 17 00:00:00 2001 From: ChaYoung You Date: Sat, 5 Jul 2014 18:54:26 +0900 Subject: [PATCH 001/407] Use category in downcase only for URL (Resolves #1739) --- features/post_data.feature | 8 ++-- lib/jekyll/post.rb | 6 +-- ...13-07-22-post-excerpt-with-layout.markdown | 1 + test/source/_posts/2013-12-20-properties.text | 2 +- ...07-05-another-mixed-case-category.markdown | 7 +++ .../2014-07-05-mixed-case-category.markdown | 7 +++ test/test_excerpt.rb | 4 +- test/test_generated_site.rb | 2 +- test/test_post.rb | 46 ++++++++++++++++--- test/test_site.rb | 2 +- 10 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 test/source/_posts/2014-07-05-another-mixed-case-category.markdown create mode 100644 test/source/_posts/2014-07-05-mixed-case-category.markdown diff --git a/features/post_data.feature b/features/post_data.feature index 0ecaeef6f..736fc9363 100644 --- a/features/post_data.feature +++ b/features/post_data.feature @@ -141,7 +141,7 @@ Feature: Post data And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}" When I run jekyll build Then the _site directory should exist - And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html" + And I should see "Post categories: scifi and Movies" in "_site/scifi/movies/2009/03/27/star-wars.html" Scenario: Use post.categories variable when category is in YAML Given I have a _posts directory @@ -163,7 +163,7 @@ Feature: Post data And I have a simple layout that contains "Post category: {{ page.categories }}" When I run jekyll build Then the _site directory should exist - And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html" + And I should see "Post category: Movies" in "_site/movies/2009/03/27/star-wars.html" Scenario: Use post.categories variable when categories are in YAML Given I have a _posts directory @@ -197,8 +197,8 @@ Feature: Post data And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}" When I run jekyll build Then the _site directory should exist - And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html" - And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2013/03/17/star-trek.html" + And I should see "Post categories: scifi and Movies" in "_site/scifi/movies/2009/03/27/star-wars.html" + And I should see "Post categories: SciFi and movies" in "_site/scifi/movies/2013/03/17/star-trek.html" Scenario Outline: Use page.path variable Given I have a /_posts directory diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b13deff8a..b1496de30 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -52,7 +52,7 @@ module Jekyll @base = containing_dir(source, dir) @name = name - self.categories = dir.downcase.split('/').reject { |x| x.empty? } + self.categories = dir.split('/').reject { |x| x.empty? } process(name) read_yaml(@base, name) @@ -80,7 +80,7 @@ module Jekyll categories_from_data = Utils.pluralized_array_from_hash(data, 'category', 'categories') self.categories = ( Array(categories) + categories_from_data - ).map {|c| c.to_s.downcase}.flatten.uniq + ).map { |c| c.to_s }.flatten.uniq end def populate_tags @@ -218,7 +218,7 @@ module Jekyll :title => slug, :i_day => date.strftime("%-d"), :i_month => date.strftime("%-m"), - :categories => (categories || []).map { |c| c.to_s }.join('/'), + :categories => (categories || []).map { |c| c.to_s.downcase }.join('/'), :short_month => date.strftime("%b"), :short_year => date.strftime("%y"), :y_day => date.strftime("%j"), diff --git a/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown b/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown index 07b0e5f32..49586606a 100644 --- a/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +++ b/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown @@ -5,6 +5,7 @@ categories: - bar - baz - z_category +- MixedCase tags: - first - second diff --git a/test/source/_posts/2013-12-20-properties.text b/test/source/_posts/2013-12-20-properties.text index 94ded5982..c0d72ce76 100644 --- a/test/source/_posts/2013-12-20-properties.text +++ b/test/source/_posts/2013-12-20-properties.text @@ -1,5 +1,5 @@ --- -categories: foo bar baz +categories: foo bar baz MixedCase foo: bar layout: default tags: ay bee cee diff --git a/test/source/_posts/2014-07-05-another-mixed-case-category.markdown b/test/source/_posts/2014-07-05-another-mixed-case-category.markdown new file mode 100644 index 000000000..419ddab55 --- /dev/null +++ b/test/source/_posts/2014-07-05-another-mixed-case-category.markdown @@ -0,0 +1,7 @@ +--- +layout: default +title: Another Mixed Case Category in YAML +category: Mixedcase +--- + +Best *post* ever diff --git a/test/source/_posts/2014-07-05-mixed-case-category.markdown b/test/source/_posts/2014-07-05-mixed-case-category.markdown new file mode 100644 index 000000000..92a679046 --- /dev/null +++ b/test/source/_posts/2014-07-05-mixed-case-category.markdown @@ -0,0 +1,7 @@ +--- +layout: default +title: Mixed Case Category in YAML +category: MixedCase +--- + +Best *post* ever diff --git a/test/test_excerpt.rb b/test/test_excerpt.rb index b6300fde5..e5523ad68 100644 --- a/test/test_excerpt.rb +++ b/test/test_excerpt.rb @@ -80,9 +80,9 @@ class TestExcerpt < Test::Unit::TestCase context "#to_liquid" do should "contain the proper page data to mimick the post liquid" do assert_equal "Post Excerpt with Layout", @excerpt.to_liquid["title"] - assert_equal "/bar/baz/z_category/2013/07/22/post-excerpt-with-layout.html", @excerpt.to_liquid["url"] + assert_equal "/bar/baz/z_category/mixedcase/2013/07/22/post-excerpt-with-layout.html", @excerpt.to_liquid["url"] assert_equal Time.parse("2013-07-22"), @excerpt.to_liquid["date"] - assert_equal %w[bar baz z_category], @excerpt.to_liquid["categories"] + assert_equal %w[bar baz z_category MixedCase], @excerpt.to_liquid["categories"] assert_equal %w[first second third jekyllrb.com], @excerpt.to_liquid["tags"] assert_equal "_posts/2013-07-22-post-excerpt-with-layout.markdown", @excerpt.to_liquid["path"] end diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index ca3124c50..0b157e85f 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase end should "ensure post count is as expected" do - assert_equal 42, @site.posts.size + assert_equal 44, @site.posts.size end should "insert site.posts into the index" do diff --git a/test/test_post.rb b/test/test_post.rb index 98a3ff4bf..44cc96640 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -31,13 +31,13 @@ class TestPost < Test::Unit::TestCase post = setup_post('2013-12-20-properties.text') attrs = { - categories: %w(foo bar baz), + categories: %w(foo bar baz MixedCase), content: "All the properties.\n\nPlus an excerpt.\n", date: Time.new(2013, 12, 20), - dir: "/foo/bar/baz/2013/12/20", + dir: "/foo/bar/baz/mixedcase/2013/12/20", excerpt: "All the properties.\n\n", foo: 'bar', - id: "/foo/bar/baz/2013/12/20/properties", + id: "/foo/bar/baz/mixedcase/2013/12/20/properties", layout: 'default', name: nil, path: "_posts/2013-12-20-properties.text", @@ -45,7 +45,7 @@ class TestPost < Test::Unit::TestCase published: nil, tags: %w(ay bee cee), title: 'Properties Post', - url: "/foo/bar/baz/2013/12/20/properties.html" + url: "/foo/bar/baz/mixedcase/2013/12/20/properties.html" } attrs.each do |attr, val| @@ -253,14 +253,26 @@ class TestPost < Test::Unit::TestCase context "with space (categories)" do setup do - @post.categories << "French cuisine" - @post.categories << "Belgian beer" + @post.categories << "french cuisine" + @post.categories << "belgian beer" @post.process(@fake_file) end should "process the url correctly" do assert_equal "/:categories/:year/:month/:day/:title.html", @post.template - assert_equal "/French%20cuisine/Belgian%20beer/2008/09/09/foo-bar.html", @post.url + assert_equal "/french%20cuisine/belgian%20beer/2008/09/09/foo-bar.html", @post.url + end + end + + context "with mixed case (category)" do + setup do + @post.categories << "MixedCase" + @post.process(@fake_file) + end + + should "process the url correctly" do + assert_equal "/:categories/:year/:month/:day/:title.html", @post.template + assert_equal "/mixedcase/2008/09/09/foo-bar.html", @post.url end end @@ -517,6 +529,12 @@ class TestPost < Test::Unit::TestCase assert !post.categories.include?(2013) end + should "recognize mixed case category in yaml" do + post = setup_post("2014-07-05-mixed-case-category.markdown") + assert post.categories.include?('MixedCase') + assert !post.categories.include?('mixedcase') + end + should "recognize tag in yaml" do post = setup_post("2009-05-18-tag.textile") assert post.tags.include?('code') @@ -589,6 +607,20 @@ class TestPost < Test::Unit::TestCase 'escape-+ %20[].html')) end + should "write properly when category has different letter case" do + %w(2014-07-05-mixed-case-category.markdown 2014-07-05-another-mixed-case-category.markdown).each do |file| + post = setup_post(file) + do_render(post) + post.write(dest_dir) + end + + assert File.directory?(dest_dir) + assert File.exist?(File.join(dest_dir, 'mixedcase', '2014', '07', '05', + 'mixed-case-category.html')) + assert File.exist?(File.join(dest_dir, 'mixedcase', '2014', '07', '05', + 'another-mixed-case-category.html')) + end + should "write properly without html extension" do post = setup_post("2008-10-18-foo-bar.textile") post.site.permalink_style = ":title" diff --git a/test/test_site.rb b/test/test_site.rb index a343b1c9e..898a02351 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -212,7 +212,7 @@ class TestSite < Test::Unit::TestCase posts = Dir[source_dir("**", "_posts", "**", "*")] posts.delete_if { |post| File.directory?(post) && !Post.valid?(post) } - categories = %w(2013 bar baz category foo z_category publish_test win).sort + categories = %w(2013 bar baz category foo z_category MixedCase Mixedcase publish_test win).sort assert_equal posts.size - @num_invalid_posts, @site.posts.size assert_equal categories, @site.categories.keys.sort From c8d1c3d2640a88cb6fb719f78402c1a7d0eb8836 Mon Sep 17 00:00:00 2001 From: ChaYoung You Date: Mon, 7 Jul 2014 15:00:22 +0900 Subject: [PATCH 002/407] Remove duplicated mixed case categories --- lib/jekyll/post.rb | 2 +- test/test_post.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b1496de30..4afe82e68 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -218,7 +218,7 @@ module Jekyll :title => slug, :i_day => date.strftime("%-d"), :i_month => date.strftime("%-m"), - :categories => (categories || []).map { |c| c.to_s.downcase }.join('/'), + :categories => (categories || []).map { |c| c.to_s.downcase }.uniq.join('/'), :short_month => date.strftime("%b"), :short_year => date.strftime("%y"), :y_day => date.strftime("%j"), diff --git a/test/test_post.rb b/test/test_post.rb index 44cc96640..0e6861ce9 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -276,6 +276,19 @@ class TestPost < Test::Unit::TestCase end end + context "with duplicated mixed case (categories)" do + setup do + @post.categories << "MixedCase" + @post.categories << "Mixedcase" + @post.process(@fake_file) + end + + should "process the url correctly" do + assert_equal "/:categories/:year/:month/:day/:title.html", @post.template + assert_equal "/mixedcase/2008/09/09/foo-bar.html", @post.url + end + end + context "with none style" do setup do @post.site.permalink_style = :none From 3b7091aab7ef169ca7d05f45a54cfe750364d21c Mon Sep 17 00:00:00 2001 From: Kamil Dziemianowicz Date: Wed, 20 Aug 2014 00:07:51 +0200 Subject: [PATCH 003/407] Find variables in _config.yaml by searching with relative file path. --- features/frontmatter_defaults.feature | 26 ++++++++++++++++++++++++-- lib/jekyll/post.rb | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/features/frontmatter_defaults.feature b/features/frontmatter_defaults.feature index 7ac2d0a8e..0d0578e27 100644 --- a/features/frontmatter_defaults.feature +++ b/features/frontmatter_defaults.feature @@ -54,6 +54,28 @@ Feature: frontmatter defaults And I should see "root: Overview for the webpage" in "_site/index.html" And I should see "subfolder: Overview for the special section" in "_site/special/index.html" + Scenario: Use frontmatter variables by relative path + Given I have a _layouts directory + And I have a main layout that contains "main: {{ content }}" + + And I have a _posts directory + And I have the following post: + | title | date | content | + | about | 2013-10-14 | content of site/2013/10/14/about.html | + And I have a special/_posts directory + And I have the following post in "special": + | title | date | path | content | + | about1 | 2013-10-14 | local | content of site/special/2013/10/14/about1.html | + | about2 | 2013-10-14 | local | content of site/special/2013/10/14/about2.html | + + And I have a configuration file with "defaults" set to "[{scope: {path: "special"}, values: {layout: "main"}}, {scope: {path: "special/_posts"}, values: {layout: "main"}}, {scope: {path: "_posts"}, values: {layout: "main"}}]" + + When I run jekyll build + Then the _site directory should exist + And I should see "main:

content of site/2013/10/14/about.html

" in "_site/2013/10/14/about.html" + And I should see "main:

content of site/special/2013/10/14/about1.html

" in "_site/special/2013/10/14/about1.html" + And I should see "main:

content of site/special/2013/10/14/about2.html

" in "_site/special/2013/10/14/about2.html" + Scenario: Override frontmatter defaults by type Given I have a _posts directory And I have the following post: @@ -81,7 +103,7 @@ Feature: frontmatter defaults Scenario: Use frontmatter defaults in collections Given I have a _slides directory And I have a "index.html" file that contains "nothing" - And I have a "_slides/slide1.html" file with content: + And I have a "_slides/slide1.html" file with content: """ --- --- @@ -107,7 +129,7 @@ Feature: frontmatter defaults Scenario: Override frontmatter defaults inside a collection Given I have a _slides directory And I have a "index.html" file that contains "nothing" - And I have a "_slides/slide2.html" file with content: + And I have a "_slides/slide2.html" file with content: """ --- myval: Override diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b13deff8a..3f6b73cdb 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -57,7 +57,7 @@ module Jekyll read_yaml(@base, name) data.default_proc = proc do |hash, key| - site.frontmatter_defaults.find(File.join(dir, name), type, key) + site.frontmatter_defaults.find(relative_path, type, key) end if data.key?('date') From 1aa9d6255e81d8057e7d2e2f5d539bf242aab935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Matall=C3=ADn?= Date: Wed, 20 Aug 2014 22:34:43 +0200 Subject: [PATCH 004/407] Add jekyll-thumbnail-filter to plugins list --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 0b62dc851..64ec283e8 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -464,6 +464,7 @@ You can find a few useful plugins at the following locations: - [jekyll-humanize](https://github.com/23maverick23/jekyll-humanize): This is a port of the Django app humanize which adds a "human touch" to data. Each method represents a Fluid type filter that can be used in your Jekyll site templates. Given that Jekyll produces static sites, some of the original methods do not make logical sense to port (e.g. naturaltime). - [Jekyll-Ordinal](https://github.com/PatrickC8t/Jekyll-Ordinal): Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th". - [Deprecated articles keeper](https://github.com/kzykbys/JekyllPlugins) by [Kazuya Kobayashi](http://blog.kazuya.co/): A simple Jekyll filter which monitor how old an article is. +- [Jekyll Thumbnail Filter](https://github.com/matallo/jekyll-thumbnail-filter): Related posts thumbnail filter. #### Tags From 6c0e791236d97830c6580fe93322e4f888567a6c Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Wed, 10 Sep 2014 21:04:40 -0700 Subject: [PATCH 005/407] Use relative path for `path` Liquid variable in Documents --- lib/jekyll/document.rb | 3 +-- test/test_document.rb | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index f4761ef8c..f7eb95693 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -232,8 +232,7 @@ module Jekyll Utils.deep_merge_hashes data, { "output" => output, "content" => content, - "path" => path, - "relative_path" => relative_path, + "path" => relative_path, "url" => url, "collection" => collection.label } diff --git a/test/test_document.rb b/test/test_document.rb index 5e26173fd..3e927acd7 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -44,6 +44,10 @@ class TestDocument < Test::Unit::TestCase assert_equal @document.to_liquid['collection'], "methods" end + should "output its relative path as path in Liquid" do + assert_equal @document.to_liquid['path'], "_methods/configuration.md" + end + end context "a document as part of a collection with frontmatter defaults" do From c3ec158f2d162f893139445893ac6ef5099c53dc Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Thu, 11 Sep 2014 18:25:21 -0700 Subject: [PATCH 006/407] Keep backwards compatibility Re-add `relative_path` Liquid variable too keep compatibility --- lib/jekyll/document.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index f7eb95693..6fe63c349 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -232,6 +232,7 @@ module Jekyll Utils.deep_merge_hashes data, { "output" => output, "content" => content, + "relative_path" => relative_path, "path" => relative_path, "url" => url, "collection" => collection.label From 46e76bde3f052dd3e9ab3cab3d1dfdc0621626d9 Mon Sep 17 00:00:00 2001 From: nitoyon Date: Sun, 14 Sep 2014 02:38:37 +0900 Subject: [PATCH 007/407] Add mode parameter to slugify Liquid filter --- lib/jekyll/filters.rb | 10 ++++---- lib/jekyll/utils.rb | 53 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index d6f0fa035..5cfcf7cb0 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -50,12 +50,12 @@ module Jekyll # Slugify a filename or title. # # input - The filename or title to slugify. + # mode - how string is slugified # - # Returns the given filename or title as a lowercase String, with every - # sequence of spaces and non-alphanumeric characters replaced with a - # hyphen. - def slugify(input) - Utils.slugify(input) + # Returns the given filename or title as a lowercase URL String. + # See Utils.slugify for more detail. + def slugify(input, mode=nil) + Utils.slugify(input, mode) end # Format a date in short format e.g. "27 Jan 2011". diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index d528f22d2..b0552168f 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -104,19 +104,50 @@ module Jekyll # Slugify a filename or title. # - # name - the filename or title to slugify + # string - the filename or title to slugify + # mode - how string is slugified # - # Returns the given filename or title in lowercase, with every - # sequence of spaces and non-alphanumeric characters replaced with a - # hyphen. - def slugify(string) - unless string.nil? - # Replace each non-alphanumeric character sequence with a hyphen - slug = string.gsub(/[^a-z0-9]+/i, '-') - # Remove leading/trailing hyphen - slug.gsub!(/^\-|\-$/i, '') - slug.downcase + # When mode is "none", return the given string in lowercase. + # + # When mode is "raw", return the given string in lowercase, + # with every sequence of spaces characters replaced with a hyphen. + # + # When mode is "default" or nil, non-alphabetic characters are + # replaced with a hyphen too. + # + # When mode is "pretty", some non-alphabetic characters (._~!$&'()+,;=@) + # are not replaced with hyphen. + # + # Examples: + # slugify("The _config.yml file") + # # => "the-config-yml-file" + # + # slugify("The _config.yml file", "pretty") + # # => "the-_config.yml-file" + # + # Returns the slugified string. + def slugify(string, mode=nil) + mode ||= 'default' + return nil if string.nil? + + # Replace each character sequence with a hyphen + re = case mode + when 'raw' + Regexp.new('\\s+') + when 'default' + Regexp.new('[^a-zA-Z0-9]+') + when 'pretty' + # "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL + # and is allowed in both extN and NTFS. + Regexp.new("[^a-zA-Z0-9._~!$&'()+,;=@]+") + else + return string.downcase end + slug = string.gsub(re, '-') + + # Remove leading/trailing hyphen + slug.gsub!(/^\-|\-$/i, '') + slug.downcase end end From 3c5e9f53346d8fbe2ed1e079f9377c603aecf93e Mon Sep 17 00:00:00 2001 From: nitoyon Date: Sun, 14 Sep 2014 02:43:17 +0900 Subject: [PATCH 008/407] Add tests for mode parameters of slugify Liquid filter --- test/test_filters.rb | 4 ++++ test/test_utils.rb | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/test_filters.rb b/test/test_filters.rb index 35ea6f0b2..a6be08008 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -221,6 +221,10 @@ class TestFilters < Test::Unit::TestCase should "return a slugified string" do assert_equal "q-bert-says", @filter.slugify(" Q*bert says @!#?@!") end + + should "return a slugified string with mode" do + assert_equal "q-bert-says-@!-@!", @filter.slugify(" Q*bert says @!#?@!", "pretty") + end end context "push filter" do diff --git a/test/test_utils.rb b/test/test_utils.rb index ddc8750e4..fc2d9b5d9 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -139,6 +139,26 @@ class TestUtils < Test::Unit::TestCase Utils.slugify(title) assert_equal "Quick-start guide", title end + + should "not change behaviour if mode is default" do + assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", "default") + end + + should "not change behaviour if mode is nil" do + assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", nil) + end + + should "not replace period and underscore if mode is pretty" do + assert_equal "the-_config.yml-file", Utils.slugify("The _config.yml file?", "pretty") + end + + should "only replace whitespace if mode is raw" do + assert_equal "the-_config.yml-file?", Utils.slugify("The _config.yml file?", "raw") + end + + should "return the given string if mode is none" do + assert_equal "the _config.yml file?", Utils.slugify("The _config.yml file?", "none") + end end end From ae57f693e450dc5d67c042db522b3b1c2fa94e66 Mon Sep 17 00:00:00 2001 From: nitoyon Date: Sun, 14 Sep 2014 02:43:25 +0900 Subject: [PATCH 009/407] Document the mode parameter of slugify Liquid filter --- site/_docs/templates.md | 20 ++++++++++++++++++-- site/_sass/_style.scss | 8 ++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index fbf636269..36a06e4c4 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -214,11 +214,27 @@ common tasks easier.

Slugify

-

Convert a string into a lowercase URL "slug" by replacing every sequence of spaces and non-alphanumeric characters with a hyphen.

+

Convert a string into a lowercase URL "slug".

+

Optional argument mode specify what characters are replaced with a hyphen. The default value is 'default'.

+
    +
  • 'none': no characters
  • +
  • 'raw': spaces
  • +
  • 'default': spaces and non-alphanumeric characters
  • +
  • 'pretty': spaces and non-alphanumeric characters except for ._~!$&'()+,;=@
  • +

- {% raw %}{{ page.title | slugify }}{% endraw %} + {% raw %}{{ "The _config.yml file" | slugify }}{% endraw %} +

+

+ the-config-yml-file +

+

+ {% raw %}{{ "The _config.yml file" | slugify: 'pretty' }}{% endraw %} +

+

+ the-_config.yml-file

diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss index 16cc902fb..8f635e3fa 100644 --- a/site/_sass/_style.scss +++ b/site/_sass/_style.scss @@ -834,10 +834,14 @@ td { padding: .5em .75em; } -td p { +td p, td ul, article td li { margin: 0; } +td ul { + padding: 0 0 0 1.2em; +} + th { text-transform: uppercase; font-size: 16px; @@ -861,7 +865,7 @@ tbody td { filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1affffff', endColorstr='#00ffffff',GradientType=0 ); } -td p { +td p, td ul { font-size: 16px; } From f9e249ae20edb1234969092def26b62cbcbfa490 Mon Sep 17 00:00:00 2001 From: Renaud Martinet Date: Fri, 31 Oct 2014 15:56:03 +0100 Subject: [PATCH 010/407] Generalize Utils#slugify for any scripts It replaces any non alphanumeric glyphs by an hyphen. --- lib/jekyll/utils.rb | 2 +- test/test_utils.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index 34861593a..fbdcd27be 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -113,7 +113,7 @@ module Jekyll unless string.nil? string \ # Replace each non-alphanumeric character sequence with a hyphen - .gsub(/[^a-z0-9]+/i, '-') \ + .gsub(/[^[:alnum:]]+/i, '-') \ # Remove leading/trailing hyphen .gsub(/^\-|\-$/i, '') \ # Downcase it diff --git a/test/test_utils.rb b/test/test_utils.rb index ddc8750e4..6e643856b 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -120,6 +120,7 @@ class TestUtils < Test::Unit::TestCase should "drop trailing punctuation" do assert_equal "so-what-is-jekyll-exactly", Utils.slugify("So what is Jekyll, exactly?") + assert_equal "كيف-حالك", Utils.slugify("كيف حالك؟") end should "ignore hyphens" do @@ -134,6 +135,10 @@ class TestUtils < Test::Unit::TestCase assert_equal "customizing-git-git-hooks", Utils.slugify("Customizing Git - Git Hooks") end + should "replace punctuation in any scripts by hyphens" do + assert_equal "5時-6時-三-一四", Utils.slugify("5時〜6時 三・一四") + end + should "not modify the original string" do title = "Quick-start guide" Utils.slugify(title) From d7e3d4df8fae5c70619eba9cfcc1ff83c4aae22e Mon Sep 17 00:00:00 2001 From: David Williamson Date: Thu, 20 Nov 2014 14:38:17 -0600 Subject: [PATCH 011/407] Add support for collections documents to have YAML front matter ending in dots. --- lib/jekyll/document.rb | 2 +- test/source/_methods/yaml_with_dots.md | 8 ++++++++ test/test_collections.rb | 1 + test/test_document.rb | 20 ++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/source/_methods/yaml_with_dots.md diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 003c04eb7..babc974a3 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -210,7 +210,7 @@ module Jekyll @data = defaults end @content = File.read(path, merged_file_read_opts(opts)) - if content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m + if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m @content = $POSTMATCH data_file = SafeYAML.load($1) unless data_file.nil? diff --git a/test/source/_methods/yaml_with_dots.md b/test/source/_methods/yaml_with_dots.md new file mode 100644 index 000000000..eb0b6675b --- /dev/null +++ b/test/source/_methods/yaml_with_dots.md @@ -0,0 +1,8 @@ +--- +title: "YAML with Dots" +whatever: foo.bar +... + +Use `{{ page.title }}` to build a full configuration for use w/Jekyll. + +Whatever: {{ page.whatever }} diff --git a/test/test_collections.rb b/test/test_collections.rb index 1975e402c..de4dfa070 100644 --- a/test/test_collections.rb +++ b/test/test_collections.rb @@ -138,6 +138,7 @@ class TestCollections < Test::Unit::TestCase _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md + _methods/yaml_with_dots.md ], doc.relative_path end end diff --git a/test/test_document.rb b/test/test_document.rb index 90c16b823..60a564217 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -44,6 +44,26 @@ class TestDocument < Test::Unit::TestCase }, @document.data) end + context "with YAML ending in three dots" do + + setup do + @site = Site.new(Jekyll.configuration({ + "collections" => ["methods"], + "source" => source_dir, + "destination" => dest_dir + })) + @site.process + @document = @site.collections["methods"].docs.last + end + + should "know its data" do + assert_equal({ + "title" => "YAML with Dots", + "whatever" => "foo.bar" + }, @document.data) + end + end + should "output the collection name in the #to_liquid method" do assert_equal @document.to_liquid['collection'], "methods" end From 11917645f2159e7c94449e1103237dddee0f42de Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sat, 15 Nov 2014 22:47:22 -0800 Subject: [PATCH 012/407] Incremental regeneration --- lib/jekyll.rb | 1 + lib/jekyll/cleaner.rb | 9 +++- lib/jekyll/command.rb | 1 + lib/jekyll/convertible.rb | 6 +++ lib/jekyll/layout.rb | 4 ++ lib/jekyll/metadata.rb | 87 ++++++++++++++++++++++++++++++++++++++ lib/jekyll/renderer.rb | 6 +++ lib/jekyll/site.rb | 21 +++++++-- lib/jekyll/tags/include.rb | 9 +++- site/.gitignore | 1 + 10 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 lib/jekyll/metadata.rb diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 03724100b..0a7c2b697 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -48,6 +48,7 @@ module Jekyll autoload :Layout, 'jekyll/layout' autoload :LayoutReader, 'jekyll/layout_reader' autoload :LogAdapter, 'jekyll/log_adapter' + autoload :Metadata, 'jekyll/metadata' autoload :Page, 'jekyll/page' autoload :PluginManager, 'jekyll/plugin_manager' autoload :Post, 'jekyll/post' diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 6dd59ea05..79f97f472 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -21,7 +21,14 @@ module Jekyll # # Returns an Array of the file and directory paths def obsolete_files - (existing_files - new_files - new_dirs + replaced_files).to_a + (existing_files - new_files - new_dirs + replaced_files + metadata_file).to_a + end + + # Private: The metadata file storing dependency tree and build history + # + # Returns an Array with the metdata file as the only item + def metadata_file + [site.metadata.metadata_file] end # Private: The list of existing files, apart from those included in keep_files and hidden files. diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index a1cc8c013..d463d235a 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -58,6 +58,7 @@ module Jekyll c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished' c.option 'quiet', '-q', '--quiet', 'Silence output.' c.option 'verbose', '-V', '--verbose', 'Print verbose output.' + c.option 'clean', '-c', '--clean', 'Clean the site before rebuilding.' end end diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 4b21a66b0..4b1f3761a 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -207,6 +207,12 @@ module Jekyll info, File.join(site.config['layouts'], layout.name)) + # Add layout to dependency tree + site.metadata.add_dependency( + Jekyll.sanitized_path(site.source, path), + Jekyll.sanitized_path(site.source, layout.path) + ) + if layout = layouts[layout.data["layout"]] if used.include?(layout) layout = nil # avoid recursive chain diff --git a/lib/jekyll/layout.rb b/lib/jekyll/layout.rb index 4dde59b66..f973019f6 100644 --- a/lib/jekyll/layout.rb +++ b/lib/jekyll/layout.rb @@ -8,6 +8,9 @@ module Jekyll # Gets the name of this layout. attr_reader :name + # Gets the path to this layout. + attr_reader :path + # Gets/Sets the extension of this layout. attr_accessor :ext @@ -26,6 +29,7 @@ module Jekyll @site = site @base = base @name = name + @path = Jekyll.sanitized_path(site.source, File.join(base, name)) self.data = {} diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb new file mode 100644 index 000000000..abda35e59 --- /dev/null +++ b/lib/jekyll/metadata.rb @@ -0,0 +1,87 @@ +require 'set' + +module Jekyll + class Metadata + attr_reader :site, :metadata + + def initialize(site) + @site = site + + # Initialize metadata store by reading YAML file, + # or an empty hash if file does not exist + @metadata = (File.file?(metadata_file) && !(site.config['clean'])) ? SafeYAML.load(File.read(metadata_file)) : {} + + # Initialize cache to an empty hash + @cache = {} + end + + # Add a path to the metadata + # + # Returns true. + def add(path) + @metadata[path] = { + "mtime" => File.mtime(path), + "deps" => [] + } + @cache[path] = true + end + + # Force a path to regenerate + # + # Returns true. + def force(path) + @cache[path] = true + end + + # Checks if a path should be regenerated + # + # Returns a boolean. + def regenerate?(path) + # Check for path in cache + if @cache.has_key? path + return @cache[path] + end + + # Check path that exists in metadata + if (data = @metadata[path]) + data["deps"].each do |dependency| + if regenerate?(dependency) + return @cache[dependency] = @cache[path] = true + end + end + if data["mtime"] == File.mtime(path) + return @cache[path] = false + else + return add(path) + end + end + + # Path does not exist in metadata, add it + return add(path) + end + + # Add a dependency of a path + # + # Returns true. + def add_dependency(path, dependency) + @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency + add(dependency) + end + + # Write the metadata to disk + # + # Returns nothing. + def write + File.open(metadata_file, 'w') do |f| + f.write(@metadata.to_yaml) + end + end + + # Produce the absolute path of the metadata file + # + # Returns the String path of the file. + def metadata_file + Jekyll.sanitized_path(site.source, '.jekyll-metadata') + end + end +end diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index f88a41874..618393531 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -138,6 +138,12 @@ module Jekyll File.join(site.config['layouts'], layout.name) ) + # Add layout to dependency tree + site.metadata.add_dependency( + Jekyll.sanitized_path(site.source, document.path), + Jekyll.sanitized_path(site.source, layout.path) + ) + if layout = site.layouts[layout.data["layout"]] if used.include?(layout) layout = nil # avoid recursive chain diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 115b41338..38c61661a 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -11,6 +11,7 @@ module Jekyll :gems, :plugin_manager attr_accessor :converters, :generators + attr_accessor :metadata # Public: Initialize a new Site. # @@ -27,6 +28,9 @@ module Jekyll @source = File.expand_path(config['source']).freeze @dest = File.expand_path(config['destination']).freeze + # Build metadata + @metadata = Metadata.new(self) + self.plugin_manager = Jekyll::PluginManager.new(self) self.plugins = plugin_manager.plugins_path @@ -49,7 +53,7 @@ module Jekyll read generate render - cleanup + cleanup if config['clean'] write end @@ -289,13 +293,17 @@ module Jekyll collections.each do |label, collection| collection.docs.each do |document| - document.output = Jekyll::Renderer.new(self, document).run + if @metadata.regenerate?(document.path) + document.output = Jekyll::Renderer.new(self, document).run + end end end payload = site_payload [posts, pages].flatten.each do |page_or_post| - page_or_post.render(layouts, payload) + if @metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) + page_or_post.render(layouts, payload) + end end rescue Errno::ENOENT => e # ignore missing layout dir @@ -312,7 +320,12 @@ module Jekyll # # Returns nothing. def write - each_site_file { |item| item.write(dest) } + each_site_file { |item| + if @metadata.regenerate? Jekyll.sanitized_path(source, item.path) + item.write(dest) + end + } + @metadata.write end # Construct a Hash of Posts indexed by the specified Post attribute. diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 3eb4d7c0a..8f7da2ca0 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -105,13 +105,20 @@ eos end def render(context) + site = context.registers[:site] dir = resolved_includes_dir(context) file = render_variable(context) || @file validate_file_name(file) path = File.join(dir, file) - validate_path(path, dir, context.registers[:site].safe) + validate_path(path, dir, site.safe) + + # Add include to dependency tree + site.metadata.add_dependency( + Jekyll.sanitized_path(site.source, context.registers[:page]["path"]), + path + ) begin partial = Liquid::Template.parse(source(path, context)) diff --git a/site/.gitignore b/site/.gitignore index 79bd74f74..c1bd964cd 100644 --- a/site/.gitignore +++ b/site/.gitignore @@ -2,3 +2,4 @@ _site/ *.swp pkg/ test/ +.jekyll-metadata From 842470b0c4d3a1e738d6226cd5800779ffab6870 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 16 Nov 2014 15:41:58 -0800 Subject: [PATCH 013/407] Refinements --- .gitignore | 1 + lib/jekyll/configuration.rb | 2 +- lib/jekyll/metadata.rb | 4 ++-- site/.gitignore | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index aa6c14f8e..d9effd5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ coverage .ruby-version .sass-cache tmp/stackprof-* +.jekyll-metadata diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 7f1148a65..24e968983 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -17,7 +17,7 @@ module Jekyll # Handling Reading 'safe' => false, 'include' => ['.htaccess'], - 'exclude' => [], + 'exclude' => ['.jekyll-metadata'], 'keep_files' => ['.git','.svn'], 'encoding' => 'utf-8', 'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md', diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index abda35e59..72cf8d154 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -62,10 +62,10 @@ module Jekyll # Add a dependency of a path # - # Returns true. + # Returns nothing. def add_dependency(path, dependency) @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency - add(dependency) + regenerate? dependency end # Write the metadata to disk diff --git a/site/.gitignore b/site/.gitignore index c1bd964cd..79bd74f74 100644 --- a/site/.gitignore +++ b/site/.gitignore @@ -2,4 +2,3 @@ _site/ *.swp pkg/ test/ -.jekyll-metadata From d438362971b8a8ceaaa8d5cea6207e7db398aea8 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 16 Nov 2014 16:04:11 -0800 Subject: [PATCH 014/407] Add regenerate front-matter variable --- lib/jekyll/site.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 38c61661a..3894a2ba8 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -293,17 +293,20 @@ module Jekyll collections.each do |label, collection| collection.docs.each do |document| - if @metadata.regenerate?(document.path) - document.output = Jekyll::Renderer.new(self, document).run + document.output = Jekyll::Renderer.new(self, document).run if ( + @metadata.regenerate?(document.path) || + document.data['regenerate'] + ) end end end payload = site_payload [posts, pages].flatten.each do |page_or_post| - if @metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) - page_or_post.render(layouts, payload) - end + page_or_post.render(layouts, payload) if ( + @metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) || + page_or_post.data['regenerate'] + ) end rescue Errno::ENOENT => e # ignore missing layout dir @@ -321,9 +324,10 @@ module Jekyll # Returns nothing. def write each_site_file { |item| - if @metadata.regenerate? Jekyll.sanitized_path(source, item.path) - item.write(dest) - end + item.write(dest) if ( + @metadata.regenerate?(Jekyll.sanitized_path(source, item.path)) || + (item.respond_to?(:data) && item.data['regenerate']) + ) } @metadata.write end From fe6bfc6f1b2540dad111153d855a5ec91b2fbf33 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Fri, 21 Nov 2014 21:54:18 -0800 Subject: [PATCH 015/407] Fix failing tests --- lib/jekyll/cleaner.rb | 3 ++- lib/jekyll/metadata.rb | 15 ++++++++++++--- lib/jekyll/renderer.rb | 2 +- lib/jekyll/site.rb | 5 ++--- lib/jekyll/tags/include.rb | 10 ++++++---- test/helper.rb | 1 + test/test_document.rb | 3 ++- test/test_site.rb | 15 +++++++++++---- 8 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 79f97f472..e7ee44a0c 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -13,6 +13,7 @@ module Jekyll # Cleans up the site's destination directory def cleanup! FileUtils.rm_rf(obsolete_files) + FileUtils.rm_rf(metadata_file) if @site.config["clean"] end private @@ -21,7 +22,7 @@ module Jekyll # # Returns an Array of the file and directory paths def obsolete_files - (existing_files - new_files - new_dirs + replaced_files + metadata_file).to_a + (existing_files - new_files - new_dirs + replaced_files).to_a end # Private: The metadata file storing dependency tree and build history diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 72cf8d154..275ee9da0 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -33,10 +33,18 @@ module Jekyll @cache[path] = true end + # Clear the metadata and cache + # + # Returns nothing + def clear + @metadata = {} + @cache = {} + end + # Checks if a path should be regenerated # # Returns a boolean. - def regenerate?(path) + def regenerate?(path, add = true) # Check for path in cache if @cache.has_key? path return @cache[path] @@ -52,18 +60,19 @@ module Jekyll if data["mtime"] == File.mtime(path) return @cache[path] = false else - return add(path) + return !add || add(path) end end # Path does not exist in metadata, add it - return add(path) + return !add || add(path) end # Add a dependency of a path # # Returns nothing. def add_dependency(path, dependency) + add(path) if @metadata[path].nil? @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency regenerate? dependency end diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index 618393531..d2dd095fd 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -142,7 +142,7 @@ module Jekyll site.metadata.add_dependency( Jekyll.sanitized_path(site.source, document.path), Jekyll.sanitized_path(site.source, layout.path) - ) + ) if document.write? if layout = site.layouts[layout.data["layout"]] if used.include?(layout) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 3894a2ba8..f00e24c9b 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -53,7 +53,7 @@ module Jekyll read generate render - cleanup if config['clean'] + cleanup write end @@ -294,10 +294,9 @@ module Jekyll collections.each do |label, collection| collection.docs.each do |document| document.output = Jekyll::Renderer.new(self, document).run if ( - @metadata.regenerate?(document.path) || + @metadata.regenerate?(document.path, document.write?) || document.data['regenerate'] ) - end end end diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 8f7da2ca0..49e7357e4 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -115,10 +115,12 @@ eos validate_path(path, dir, site.safe) # Add include to dependency tree - site.metadata.add_dependency( - Jekyll.sanitized_path(site.source, context.registers[:page]["path"]), - path - ) + if context.registers[:page] and context.registers[:page].has_key? "path" + site.metadata.add_dependency( + Jekyll.sanitized_path(site.source, context.registers[:page]["path"]), + path + ) + end begin partial = Liquid::Template.parse(source(path, context)) diff --git a/test/helper.rb b/test/helper.rb index ea3777ed8..58d9e24a1 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -46,6 +46,7 @@ class Test::Unit::TestCase def clear_dest FileUtils.rm_rf(dest_dir) + FileUtils.rm_rf(source_dir('.jekyll-metadata')) end def test_dir(*subdirs) diff --git a/test/test_document.rb b/test/test_document.rb index 90c16b823..cf6c2cbfc 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -246,7 +246,8 @@ class TestDocument < Test::Unit::TestCase } }, "source" => source_dir, - "destination" => dest_dir + "destination" => dest_dir, + "clean" => true })) @site.process @document = @site.collections["slides"].files.find { |doc| doc.relative_path == "_slides/octojekyll.png" } diff --git a/test/test_site.rb b/test/test_site.rb index 4b8409e7d..2fd6ad363 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -99,6 +99,7 @@ class TestSite < Test::Unit::TestCase should "write only modified static files" do clear_dest StaticFile.reset_cache + @site.metadata.clear @site.process some_static_file = @site.static_files[0].path @@ -128,6 +129,7 @@ class TestSite < Test::Unit::TestCase should "write static files if not modified but missing in destination" do clear_dest StaticFile.reset_cache + @site.metadata.clear @site.process some_static_file = @site.static_files[0].path @@ -241,6 +243,7 @@ class TestSite < Test::Unit::TestCase context 'with orphaned files in destination' do setup do clear_dest + @site.metadata.clear @site.process # generate some orphaned files: # single file @@ -328,7 +331,7 @@ class TestSite < Test::Unit::TestCase end bad_processor = "Custom::Markdown" - s = Site.new(site_configuration('markdown' => bad_processor)) + s = Site.new(site_configuration('markdown' => bad_processor, 'clean' => true)) assert_raise Jekyll::Errors::FatalException do s.process end @@ -348,7 +351,7 @@ class TestSite < Test::Unit::TestCase should 'throw FatalException at process time' do bad_processor = 'not a processor name' - s = Site.new(site_configuration('markdown' => bad_processor)) + s = Site.new(site_configuration('markdown' => bad_processor, 'clean' => true)) assert_raise Jekyll::Errors::FatalException do s.process end @@ -418,7 +421,9 @@ class TestSite < Test::Unit::TestCase context "manipulating the Jekyll environment" do setup do - @site = Site.new(site_configuration) + @site = Site.new(site_configuration({ + "clean" => true + })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } end @@ -430,7 +435,9 @@ class TestSite < Test::Unit::TestCase context "in production" do setup do ENV["JEKYLL_ENV"] = "production" - @site = Site.new(site_configuration) + @site = Site.new(site_configuration({ + "clean" => true + })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } end From ac03af3229777ddd3fbfb43a646339789e32850a Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Fri, 21 Nov 2014 22:10:08 -0800 Subject: [PATCH 016/407] Implement @mattr-'s suggestions --- lib/jekyll/cleaner.rb | 2 +- lib/jekyll/command.rb | 2 +- lib/jekyll/configuration.rb | 2 +- lib/jekyll/metadata.rb | 15 ++++++++++++--- lib/jekyll/site.rb | 8 ++++---- test/test_document.rb | 2 +- test/test_site.rb | 8 ++++---- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index e7ee44a0c..00191db79 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -13,7 +13,7 @@ module Jekyll # Cleans up the site's destination directory def cleanup! FileUtils.rm_rf(obsolete_files) - FileUtils.rm_rf(metadata_file) if @site.config["clean"] + FileUtils.rm_rf(metadata_file) if @site.config["full_rebuild"] end private diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index d463d235a..423c32020 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -58,7 +58,7 @@ module Jekyll c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished' c.option 'quiet', '-q', '--quiet', 'Silence output.' c.option 'verbose', '-V', '--verbose', 'Print verbose output.' - c.option 'clean', '-c', '--clean', 'Clean the site before rebuilding.' + c.option 'full_rebuild', '-f', '--full-rebuild', 'Clean the site before rebuilding.' end end diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 24e968983..7f1148a65 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -17,7 +17,7 @@ module Jekyll # Handling Reading 'safe' => false, 'include' => ['.htaccess'], - 'exclude' => ['.jekyll-metadata'], + 'exclude' => [], 'keep_files' => ['.git','.svn'], 'encoding' => 'utf-8', 'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md', diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 275ee9da0..2012afc6f 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -7,9 +7,8 @@ module Jekyll def initialize(site) @site = site - # Initialize metadata store by reading YAML file, - # or an empty hash if file does not exist - @metadata = (File.file?(metadata_file) && !(site.config['clean'])) ? SafeYAML.load(File.read(metadata_file)) : {} + # Read metadata from file + read_metadata # Initialize cache to an empty hash @cache = {} @@ -92,5 +91,15 @@ module Jekyll def metadata_file Jekyll.sanitized_path(site.source, '.jekyll-metadata') end + + private + + # Read metadata from the metadata file, if no file is found, + # initialize with an empty hash + # + # Returns the read metadata. + def read_metadata + @metadata = (File.file?(metadata_file) && !(site.config['full_rebuild'])) ? SafeYAML.load(File.read(metadata_file)) : {} + end end end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index f00e24c9b..738cae0ef 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -294,7 +294,7 @@ module Jekyll collections.each do |label, collection| collection.docs.each do |document| document.output = Jekyll::Renderer.new(self, document).run if ( - @metadata.regenerate?(document.path, document.write?) || + metadata.regenerate?(document.path, document.write?) || document.data['regenerate'] ) end @@ -303,7 +303,7 @@ module Jekyll payload = site_payload [posts, pages].flatten.each do |page_or_post| page_or_post.render(layouts, payload) if ( - @metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) || + metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) || page_or_post.data['regenerate'] ) end @@ -324,11 +324,11 @@ module Jekyll def write each_site_file { |item| item.write(dest) if ( - @metadata.regenerate?(Jekyll.sanitized_path(source, item.path)) || + metadata.regenerate?(Jekyll.sanitized_path(source, item.path)) || (item.respond_to?(:data) && item.data['regenerate']) ) } - @metadata.write + metadata.write end # Construct a Hash of Posts indexed by the specified Post attribute. diff --git a/test/test_document.rb b/test/test_document.rb index cf6c2cbfc..2ff688ba2 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -247,7 +247,7 @@ class TestDocument < Test::Unit::TestCase }, "source" => source_dir, "destination" => dest_dir, - "clean" => true + "full_rebuild" => true })) @site.process @document = @site.collections["slides"].files.find { |doc| doc.relative_path == "_slides/octojekyll.png" } diff --git a/test/test_site.rb b/test/test_site.rb index 2fd6ad363..a6ef5af8e 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -331,7 +331,7 @@ class TestSite < Test::Unit::TestCase end bad_processor = "Custom::Markdown" - s = Site.new(site_configuration('markdown' => bad_processor, 'clean' => true)) + s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true)) assert_raise Jekyll::Errors::FatalException do s.process end @@ -351,7 +351,7 @@ class TestSite < Test::Unit::TestCase should 'throw FatalException at process time' do bad_processor = 'not a processor name' - s = Site.new(site_configuration('markdown' => bad_processor, 'clean' => true)) + s = Site.new(site_configuration('markdown' => bad_processor, 'full_rebuild' => true)) assert_raise Jekyll::Errors::FatalException do s.process end @@ -422,7 +422,7 @@ class TestSite < Test::Unit::TestCase context "manipulating the Jekyll environment" do setup do @site = Site.new(site_configuration({ - "clean" => true + 'full_rebuild' => true })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } @@ -436,7 +436,7 @@ class TestSite < Test::Unit::TestCase setup do ENV["JEKYLL_ENV"] = "production" @site = Site.new(site_configuration({ - "clean" => true + 'full_rebuild' => true })) @site.process @page = @site.pages.find { |p| p.name == "environment.html" } From 4acf343fea062e26def0cdef77c45a596a1a30ca Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 23 Nov 2014 12:51:19 -0800 Subject: [PATCH 017/407] Add clean command --- lib/jekyll/commands/clean.rb | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lib/jekyll/commands/clean.rb diff --git a/lib/jekyll/commands/clean.rb b/lib/jekyll/commands/clean.rb new file mode 100644 index 000000000..7d787d301 --- /dev/null +++ b/lib/jekyll/commands/clean.rb @@ -0,0 +1,42 @@ +module Jekyll + module Commands + class Clean < Command + class << self + + def init_with_program(prog) + prog.command(:clean) do |c| + c.syntax 'clean [subcommand]' + c.description 'Clean the site (removes site output and metadata file) without building.' + + c.action do |args, _| + Jekyll::Commands::Clean.process({}) + end + end + end + + def process(options) + options = configuration_from_options(options) + destination = options['destination'] + metadata_file = File.join(options['source'], '.jekyll-metadata') + + if File.directory? destination + Jekyll.logger.info "Cleaning #{destination}..." + FileUtils.rm_rf(destination) + Jekyll.logger.info "", "done." + else + Jekyll.logger.info "Nothing to do for #{destination}." + end + + if File.file? metadata_file + Jekyll.logger.info "Removing #{metadata_file}..." + FileUtils.rm_rf(metadata_file) + Jekyll.logger.info "", "done." + else + Jekyll.logger.info "Nothing to do for #{metadata_file}." + end + end + + end + end + end +end From 75c5c162979b7cd729131e682b4ac7a299ca9067 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 23 Nov 2014 14:06:29 -0800 Subject: [PATCH 018/407] Handle path overrides --- lib/jekyll/metadata.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 2012afc6f..68a31a050 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -16,8 +16,10 @@ module Jekyll # Add a path to the metadata # - # Returns true. + # Returns true, also on failure. def add(path) + return true if not File.exist? path + @metadata[path] = { "mtime" => File.mtime(path), "deps" => [] @@ -71,7 +73,8 @@ module Jekyll # # Returns nothing. def add_dependency(path, dependency) - add(path) if @metadata[path].nil? + return if @metadata[path].nil? + @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency regenerate? dependency end From 2a5cf11ee27c0faeda1009d6a8099882230038fc Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 23 Nov 2014 15:38:00 -0800 Subject: [PATCH 019/407] Add --no-metadata option --- lib/jekyll/command.rb | 1 + lib/jekyll/metadata.rb | 10 ++++++++-- lib/jekyll/site.rb | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index 423c32020..658ce5975 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -59,6 +59,7 @@ module Jekyll c.option 'quiet', '-q', '--quiet', 'Silence output.' c.option 'verbose', '-V', '--verbose', 'Print verbose output.' c.option 'full_rebuild', '-f', '--full-rebuild', 'Clean the site before rebuilding.' + c.option 'no_metadata', '--no-metadata', 'Disable incremental regeneration.' end end diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 68a31a050..3e242d694 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -46,6 +46,8 @@ module Jekyll # # Returns a boolean. def regenerate?(path, add = true) + return true if site.config['no_metadata'] + # Check for path in cache if @cache.has_key? path return @cache[path] @@ -73,7 +75,7 @@ module Jekyll # # Returns nothing. def add_dependency(path, dependency) - return if @metadata[path].nil? + return if (@metadata[path].nil? || site.config['no_metadata']) @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency regenerate? dependency @@ -102,7 +104,11 @@ module Jekyll # # Returns the read metadata. def read_metadata - @metadata = (File.file?(metadata_file) && !(site.config['full_rebuild'])) ? SafeYAML.load(File.read(metadata_file)) : {} + @metadata = if !(site.config['full_rebuild'] || site.config['no_metadata']) && File.file?(metadata_file) + SafeYAML.load(File.read(metadata_file)) + else + {} + end end end end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 738cae0ef..69f11a75d 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -328,7 +328,7 @@ module Jekyll (item.respond_to?(:data) && item.data['regenerate']) ) } - metadata.write + metadata.write unless site.config['no_metadata'] end # Construct a Hash of Posts indexed by the specified Post attribute. From dc30114605bd4c8f121a02e3d4b1aa5e700fde22 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 23 Nov 2014 15:45:49 -0800 Subject: [PATCH 020/407] Use site.in_source_dir --- lib/jekyll.rb | 1 + lib/jekyll/convertible.rb | 12 +++++++++-- lib/jekyll/document.rb | 8 ++++++++ lib/jekyll/layout.rb | 2 +- lib/jekyll/metadata.rb | 42 ++++++++++++++++++++------------------ lib/jekyll/renderer.rb | 4 ++-- lib/jekyll/site.rb | 19 +++++------------ lib/jekyll/static_file.rb | 2 ++ lib/jekyll/tags/include.rb | 2 +- test/test_document.rb | 6 +++--- 10 files changed, 55 insertions(+), 43 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 0a7c2b697..911b3ddbf 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -21,6 +21,7 @@ require 'time' require 'English' require 'pathname' require 'logger' +require 'set' # 3rd party require 'safe_yaml/load' diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 4b1f3761a..2c0d240ea 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -168,6 +168,14 @@ module Jekyll true end + # Determine whether to regenerate the file based on metadata. + # + # Returns true if file needs to be regenerated + def regenerate? + site.metadata.regenerate?(site.in_source_dir(relative_path)) || + data['regenerate'] + end + # Determine whether the file should be placed into layouts. # # Returns false if the document is an asset file. @@ -209,8 +217,8 @@ module Jekyll # Add layout to dependency tree site.metadata.add_dependency( - Jekyll.sanitized_path(site.source, path), - Jekyll.sanitized_path(site.source, layout.path) + site.in_source_dir(path), + site.in_source_dir(layout.path) ) if layout = layouts[layout.data["layout"]] diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 003c04eb7..356ce3977 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -105,6 +105,14 @@ module Jekyll !(coffeescript_file? || yaml_file?) end + # Determine whether the document should be regenerated based on metadata. + # + # Returns true if the document needs to be regenerated. + def regenerate? + site.metadata.regenerate?(path, write?) || + data['regenerate'] + end + # Determine whether the file should be placed into layouts. # # Returns false if the document is either an asset file or a yaml file, diff --git a/lib/jekyll/layout.rb b/lib/jekyll/layout.rb index f973019f6..c29f353fa 100644 --- a/lib/jekyll/layout.rb +++ b/lib/jekyll/layout.rb @@ -29,7 +29,7 @@ module Jekyll @site = site @base = base @name = name - @path = Jekyll.sanitized_path(site.source, File.join(base, name)) + @path = site.in_source_dir(base, name) self.data = {} diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 3e242d694..6a31eb258 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -1,12 +1,14 @@ -require 'set' - module Jekyll class Metadata - attr_reader :site, :metadata + attr_reader :site, :metadata, :cache def initialize(site) @site = site + # Configuration options + @full_rebuild = site.config['full_rebuild'] + @disabled = site.config['no_metadata'] + # Read metadata from file read_metadata @@ -20,48 +22,48 @@ module Jekyll def add(path) return true if not File.exist? path - @metadata[path] = { + metadata[path] = { "mtime" => File.mtime(path), "deps" => [] } - @cache[path] = true + cache[path] = true end # Force a path to regenerate # # Returns true. def force(path) - @cache[path] = true + cache[path] = true end # Clear the metadata and cache # # Returns nothing def clear - @metadata = {} - @cache = {} + metadata = {} + cache = {} end # Checks if a path should be regenerated # # Returns a boolean. def regenerate?(path, add = true) - return true if site.config['no_metadata'] + return true if @disabled # Check for path in cache - if @cache.has_key? path - return @cache[path] + if cache.has_key? path + return cache[path] end # Check path that exists in metadata - if (data = @metadata[path]) + if data = metadata[path] data["deps"].each do |dependency| if regenerate?(dependency) - return @cache[dependency] = @cache[path] = true + return cache[dependency] = cache[path] = true end end - if data["mtime"] == File.mtime(path) - return @cache[path] = false + if data["mtime"].eql? File.mtime(path) + return cache[path] = false else return !add || add(path) end @@ -75,9 +77,9 @@ module Jekyll # # Returns nothing. def add_dependency(path, dependency) - return if (@metadata[path].nil? || site.config['no_metadata']) + return if (metadata[path].nil? || @disabled) - @metadata[path]["deps"] << dependency unless @metadata[path]["deps"].include? dependency + metadata[path]["deps"] << dependency unless metadata[path]["deps"].include? dependency regenerate? dependency end @@ -86,7 +88,7 @@ module Jekyll # Returns nothing. def write File.open(metadata_file, 'w') do |f| - f.write(@metadata.to_yaml) + f.write(metadata.to_yaml) end end @@ -94,7 +96,7 @@ module Jekyll # # Returns the String path of the file. def metadata_file - Jekyll.sanitized_path(site.source, '.jekyll-metadata') + site.in_source_dir('.jekyll-metadata') end private @@ -104,7 +106,7 @@ module Jekyll # # Returns the read metadata. def read_metadata - @metadata = if !(site.config['full_rebuild'] || site.config['no_metadata']) && File.file?(metadata_file) + @metadata = if !(@full_rebuild || @disabled) && File.file?(metadata_file) SafeYAML.load(File.read(metadata_file)) else {} diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index d2dd095fd..1cdf6c2aa 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -140,8 +140,8 @@ module Jekyll # Add layout to dependency tree site.metadata.add_dependency( - Jekyll.sanitized_path(site.source, document.path), - Jekyll.sanitized_path(site.source, layout.path) + site.in_source_dir(document.path), + site.in_source_dir(layout.path) ) if document.write? if layout = site.layouts[layout.data["layout"]] diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 69f11a75d..eaf4c3cd1 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -11,7 +11,7 @@ module Jekyll :gems, :plugin_manager attr_accessor :converters, :generators - attr_accessor :metadata + attr_reader :metadata # Public: Initialize a new Site. # @@ -293,19 +293,13 @@ module Jekyll collections.each do |label, collection| collection.docs.each do |document| - document.output = Jekyll::Renderer.new(self, document).run if ( - metadata.regenerate?(document.path, document.write?) || - document.data['regenerate'] - ) + document.output = Jekyll::Renderer.new(self, document).run if document.regenerate? end end payload = site_payload [posts, pages].flatten.each do |page_or_post| - page_or_post.render(layouts, payload) if ( - metadata.regenerate?(Jekyll.sanitized_path(source, page_or_post.relative_path)) || - page_or_post.data['regenerate'] - ) + page_or_post.render(layouts, payload) if page_or_post.regenerate? end rescue Errno::ENOENT => e # ignore missing layout dir @@ -323,12 +317,9 @@ module Jekyll # Returns nothing. def write each_site_file { |item| - item.write(dest) if ( - metadata.regenerate?(Jekyll.sanitized_path(source, item.path)) || - (item.respond_to?(:data) && item.data['regenerate']) - ) + item.write(dest) if item.regenerate? } - metadata.write unless site.config['no_metadata'] + metadata.write unless config['no_metadata'] end # Construct a Hash of Posts indexed by the specified Post attribute. diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index eae85b54c..8e1006562 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -67,6 +67,8 @@ module Jekyll true end + alias_method :regenerate?, :write? + # Write the static file to the destination directory (if modified). # # dest - The String path to the destination dir. diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 49e7357e4..16da6f499 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -117,7 +117,7 @@ eos # Add include to dependency tree if context.registers[:page] and context.registers[:page].has_key? "path" site.metadata.add_dependency( - Jekyll.sanitized_path(site.source, context.registers[:page]["path"]), + site.in_source_dir(context.registers[:page]["path"]), path ) end diff --git a/test/test_document.rb b/test/test_document.rb index 2ff688ba2..57c14c223 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -245,9 +245,9 @@ class TestDocument < Test::Unit::TestCase "output" => true } }, - "source" => source_dir, - "destination" => dest_dir, - "full_rebuild" => true + "source" => source_dir, + "destination" => dest_dir, + "full_rebuild" => true })) @site.process @document = @site.collections["slides"].files.find { |doc| doc.relative_path == "_slides/octojekyll.png" } From 8a257aca6b40adc73e22909ffff0ee6e1a4818d0 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Wed, 26 Nov 2014 20:15:02 -0800 Subject: [PATCH 021/407] Implement more suggestions --- lib/jekyll/command.rb | 3 +-- lib/jekyll/metadata.rb | 19 ++++++++++++------- lib/jekyll/site.rb | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index 658ce5975..12fd66e66 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -58,8 +58,7 @@ module Jekyll c.option 'unpublished', '--unpublished', 'Render posts that were marked as unpublished' c.option 'quiet', '-q', '--quiet', 'Silence output.' c.option 'verbose', '-V', '--verbose', 'Print verbose output.' - c.option 'full_rebuild', '-f', '--full-rebuild', 'Clean the site before rebuilding.' - c.option 'no_metadata', '--no-metadata', 'Disable incremental regeneration.' + c.option 'full_rebuild', '-f', '--full-rebuild', 'Disable incremental rebuild.' end end diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 6a31eb258..de9731d46 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -5,10 +5,6 @@ module Jekyll def initialize(site) @site = site - # Configuration options - @full_rebuild = site.config['full_rebuild'] - @disabled = site.config['no_metadata'] - # Read metadata from file read_metadata @@ -48,7 +44,7 @@ module Jekyll # # Returns a boolean. def regenerate?(path, add = true) - return true if @disabled + return true if disabled? # Check for path in cache if cache.has_key? path @@ -56,7 +52,8 @@ module Jekyll end # Check path that exists in metadata - if data = metadata[path] + data = metadata[path] + if data data["deps"].each do |dependency| if regenerate?(dependency) return cache[dependency] = cache[path] = true @@ -99,6 +96,14 @@ module Jekyll site.in_source_dir('.jekyll-metadata') end + # Check if metadata has been disabled + # + # Returns a Boolean (true for disabled, false for enabled). + def disabled? + @disabled = site.config['full_rebuild'] if @disabled.nil? + @disabled + end + private # Read metadata from the metadata file, if no file is found, @@ -106,7 +111,7 @@ module Jekyll # # Returns the read metadata. def read_metadata - @metadata = if !(@full_rebuild || @disabled) && File.file?(metadata_file) + @metadata = if !disabled? && File.file?(metadata_file) SafeYAML.load(File.read(metadata_file)) else {} diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index eaf4c3cd1..4b8518c2b 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -319,7 +319,7 @@ module Jekyll each_site_file { |item| item.write(dest) if item.regenerate? } - metadata.write unless config['no_metadata'] + metadata.write unless config['full_rebuild'] end # Construct a Hash of Posts indexed by the specified Post attribute. From 02f281eef3ead61af68f38b439eec1f859a2f2ad Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Wed, 26 Nov 2014 21:15:53 -0800 Subject: [PATCH 022/407] Add unit and cucumber tests --- features/incremental_rebuild.feature | 60 +++++++++++++++++++++++ features/step_definitions/jekyll_steps.rb | 4 ++ lib/jekyll/metadata.rb | 4 +- test/test_metadata.rb | 38 ++++++++++++++ 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 features/incremental_rebuild.feature create mode 100644 test/test_metadata.rb diff --git a/features/incremental_rebuild.feature b/features/incremental_rebuild.feature new file mode 100644 index 000000000..08739d3ef --- /dev/null +++ b/features/incremental_rebuild.feature @@ -0,0 +1,60 @@ +Feature: Incremental rebuild + As an impatient hacker who likes to blog + I want to be able to make a static site + Without waiting too long for it to build + + Scenario: Produce correct output site + Given I have a _layouts directory + And I have a _posts directory + And I have the following posts: + | title | date | layout | content | + | Wargames | 2009-03-27 | default | The only winning move is not to play. | + And I have a default layout that contains "Post Layout: {{ content }}" + When I run jekyll build + Then the _site directory should exist + And I should see "Post Layout:

The only winning move is not to play.

" in "_site/2009/03/27/wargames.html" + When I run jekyll build + Then the _site directory should exist + And I should see "Post Layout:

The only winning move is not to play.

" in "_site/2009/03/27/wargames.html" + + Scenario: Generate a metadata file + Given I have an "index.html" file that contains "Basic Site" + When I run jekyll build + Then the ".jekyll-metadata" file should exist + + Scenario: Rebuild when content is changed + Given I have an "index.html" file that contains "Basic Site" + When I run jekyll build + Then the _site directory should exist + And I should see "Basic Site" in "_site/index.html" + When I wait 1 second + Then I have an "index.html" file that contains "Bacon Site" + When I run jekyll build + Then the _site directory should exist + And I should see "Bacon Site" in "_site/index.html" + + Scenario: Rebuild when layout is changed + Given I have a _layouts directory + And I have an "index.html" page with layout "default" that contains "Basic Site with Layout" + And I have a default layout that contains "Page Layout: {{ content }}" + When I run jekyll build + Then the _site directory should exist + And I should see "Page Layout: Basic Site with Layout" in "_site/index.html" + When I wait 1 second + Then I have a default layout that contains "Page Layout Changed: {{ content }}" + When I run jekyll build --full-rebuild + Then the _site directory should exist + And I should see "Page Layout Changed: Basic Site with Layout" in "_site/index.html" + + Scenario: Rebuild when an include is changed + Given I have a _includes directory + And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}" + And I have an "_includes/about.textile" file that contains "Generated by Jekyll" + When I run jekyll build + Then the _site directory should exist + And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html" + When I wait 1 second + Then I have an "_includes/about.textile" file that contains "Regenerated by Jekyll" + When I run jekyll build + Then the _site directory should exist + And I should see "Basic Site with include tag: Regenerated by Jekyll" in "_site/index.html" diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index b75379f51..069f93b0f 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -133,6 +133,10 @@ Given /^I have fixture collections$/ do FileUtils.cp_r File.join(JEKYLL_SOURCE_DIR, "test", "source", "_methods"), source_dir end +Given /^I wait (\d+) second(s?)$/ do |time, plural| + sleep(time.to_f) +end + ################## # # Changing stuff diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index de9731d46..97fc0bf55 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -36,8 +36,8 @@ module Jekyll # # Returns nothing def clear - metadata = {} - cache = {} + @metadata = {} + @cache = {} end # Checks if a path should be regenerated diff --git a/test/test_metadata.rb b/test/test_metadata.rb new file mode 100644 index 000000000..dcc3a6011 --- /dev/null +++ b/test/test_metadata.rb @@ -0,0 +1,38 @@ +require 'helper' + +class TestMetadata < Test::Unit::TestCase + context "The site metadata" do + setup do + FileUtils.rm_rf(source_dir(".jekyll-metadata")) + + @site = Site.new(Jekyll.configuration({ + "source" => source_dir, + "destination" => dest_dir + })) + + @site.process + @path = @site.in_source_dir(@site.pages.first.path) + @metadata = @site.metadata + end + + should "store modification times" do + assert_equal @metadata.metadata[@path]["mtime"], File.mtime(@path) + end + + should "cache processed entries" do + assert @metadata.cache[@path] + end + + should "write to the metadata file" do + @metadata.clear + @metadata.add(@path) + @metadata.write + assert File.file?(source_dir(".jekyll-metadata")) + end + + should "read from the metadata file" do + @metadata = Metadata.new(@site) + assert_equal @metadata.metadata[@path]["mtime"], File.mtime(@path) + end + end +end From 229303bbc8cea179737403fc8465db3c21100879 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Thu, 27 Nov 2014 04:01:25 -0600 Subject: [PATCH 023/407] compare resulting data in jsonify test --- test/test_filters.rb | 66 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/test/test_filters.rb b/test/test_filters.rb index d46d93520..a9fc951db 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -160,14 +160,70 @@ class TestFilters < Test::Unit::TestCase end should "call #to_liquid " do - expected = "[{\"name\":\"Jeremiah\",\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true},{\"name\":\"Smathers\",\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true}]" - assert_equal expected, @filter.jsonify([T.new("Jeremiah"), T.new("Smathers")]) + expected = [ + { + "name" => "Jeremiah", + "v" => 1, + "thing" => [ + { + "kay" => "jewelers" + } + ], + "stuff" => true + }, + { + "name" => "Smathers", + "v" => 1, + "thing" => [ + { + "kay" => "jewelers" + } + ], + "stuff" => true + } + ] + result = @filter.jsonify([T.new("Jeremiah"), T.new("Smathers")]) + assert_equal expected, JSON.parse(result) end should "handle hashes with all sorts of weird keys and values" do - my_hash = { "posts" => Array.new(5) { |i| T.new(i) } } - expected = "{\"posts\":[{\"name\":0,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true},{\"name\":1,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true},{\"name\":2,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true},{\"name\":3,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true},{\"name\":4,\"v\":1,\"thing\":[{\"kay\":\"jewelers\"}],\"stuff\":true}]}" - assert_equal expected, @filter.jsonify(my_hash) + my_hash = { "posts" => Array.new(3) { |i| T.new(i) } } + expected = { + "posts" => [ + { + "name" => 0, + "v" => 1, + "thing" => [ + { + "kay" => "jewelers" + } + ], + "stuff" => true + }, + { + "name" => 1, + "v" => 1, + "thing" => [ + { + "kay" => "jewelers" + } + ], + "stuff" => true + }, + { + "name" => 2, + "v" => 1, + "thing" => [ + { + "kay" => "jewelers" + } + ], + "stuff" => true + } + ] + } + result = @filter.jsonify(my_hash) + assert_equal expected, JSON.parse(result) end end From 87d08ec827f035f5d57cb86818a0280962b22846 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Thu, 27 Nov 2014 04:16:29 -0600 Subject: [PATCH 024/407] refactor #as_liquid --- lib/jekyll/filters.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 2e4a11748..fc0907a96 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -328,14 +328,23 @@ module Jekyll def as_liquid(item) case item - when String, Numeric, true, false, nil - item.to_liquid when Hash - Hash[item.map { |k, v| [as_liquid(k), as_liquid(v)] }] + pairs = item.map { |k, v| as_liquid([k, v]) } + Hash[pairs] when Array item.map{ |i| as_liquid(i) } - else - item.respond_to?(:to_liquid) ? as_liquid(item.to_liquid) : item + else # simple type + if item.respond_to?(:to_liquid) + liquidated = item.to_liquid + # prevent infinite recursion + if liquidated == item + item + else + as_liquid(liquidated) + end + else + item + end end end end From 4776b27ff363fe2e7406be77f5f2f061ee8ecb8f Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Thu, 27 Nov 2014 04:20:05 -0600 Subject: [PATCH 025/407] reduce nesting of #as_liquid --- lib/jekyll/filters.rb | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index fc0907a96..e147c93e7 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -327,24 +327,21 @@ module Jekyll end def as_liquid(item) - case item - when Hash + if item.class == Hash pairs = item.map { |k, v| as_liquid([k, v]) } Hash[pairs] - when Array + elsif item.class == Array item.map{ |i| as_liquid(i) } - else # simple type - if item.respond_to?(:to_liquid) - liquidated = item.to_liquid - # prevent infinite recursion - if liquidated == item - item - else - as_liquid(liquidated) - end - else + elsif item.respond_to?(:to_liquid) + liquidated = item.to_liquid + # prevent infinite recursion for simple types (which return `self`) + if liquidated == item item + else + as_liquid(liquidated) end + else + item end end end From b6d81c58df04991fc4b1f8eeaa46a23cb3af6be5 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Thu, 27 Nov 2014 10:00:29 -0800 Subject: [PATCH 026/407] Perform less expensive operation first --- lib/jekyll/convertible.rb | 3 +-- lib/jekyll/document.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 2c0d240ea..d6ddfde65 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -172,8 +172,7 @@ module Jekyll # # Returns true if file needs to be regenerated def regenerate? - site.metadata.regenerate?(site.in_source_dir(relative_path)) || - data['regenerate'] + data['regenerate'] || site.metadata.regenerate?(site.in_source_dir(relative_path)) end # Determine whether the file should be placed into layouts. diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 356ce3977..5b1b79ab6 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -109,8 +109,7 @@ module Jekyll # # Returns true if the document needs to be regenerated. def regenerate? - site.metadata.regenerate?(path, write?) || - data['regenerate'] + data['regenerate'] || site.metadata.regenerate?(path, write?) end # Determine whether the file should be placed into layouts. From a701e59c070338677a27a5801cfa3d4feb12977c Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Thu, 27 Nov 2014 10:40:31 -0800 Subject: [PATCH 027/407] Add lots more unit tests --- test/test_metadata.rb | 106 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/test/test_metadata.rb b/test/test_metadata.rb index dcc3a6011..858b166ac 100644 --- a/test/test_metadata.rb +++ b/test/test_metadata.rb @@ -16,7 +16,7 @@ class TestMetadata < Test::Unit::TestCase end should "store modification times" do - assert_equal @metadata.metadata[@path]["mtime"], File.mtime(@path) + assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"] end should "cache processed entries" do @@ -32,7 +32,109 @@ class TestMetadata < Test::Unit::TestCase should "read from the metadata file" do @metadata = Metadata.new(@site) - assert_equal @metadata.metadata[@path]["mtime"], File.mtime(@path) + assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"] + end + + # Methods + + should "be able to add a path to the metadata" do + @metadata.clear + @metadata.add(@path) + assert_equal File.mtime(@path), @metadata.metadata[@path]["mtime"] + assert_equal [], @metadata.metadata[@path]["deps"] + assert @metadata.cache[@path] + end + + should "return true on nonexistent path" do + @metadata.clear + assert @metadata.add("/bogus/path.md") + assert @metadata.regenerate?("/bogus/path.md") + end + + should "be able to force a path to regenerate" do + @metadata.clear + @metadata.force(@path) + assert @metadata.cache[@path] + assert @metadata.regenerate?(@path) + end + + should "be able to clear metadata and cache" do + @metadata.clear + @metadata.add(@path) + assert_equal 1, @metadata.metadata.length + assert_equal 1, @metadata.cache.length + @metadata.clear + assert_equal 0, @metadata.metadata.length + assert_equal 0, @metadata.cache.length + end + + should "not regenerate a path if it is not modified" do + @metadata.clear + @metadata.add(@path) + @metadata.write + @metadata = Metadata.new(@site) + + assert !@metadata.regenerate?(@path) + end + + should "not regenerate if path in cache is false" do + @metadata.clear + @metadata.add(@path) + @metadata.write + @metadata = Metadata.new(@site) + + assert !@metadata.regenerate?(@path) + assert !@metadata.cache[@path] + assert !@metadata.regenerate?(@path) + end + + should "regenerate if path in not in metadata" do + @metadata.clear + @metadata.add(@path) + + assert @metadata.regenerate?(@path) + end + + should "regenerate if path in cache is true" do + @metadata.clear + @metadata.add(@path) + + assert @metadata.regenerate?(@path) + assert @metadata.cache[@path] + assert @metadata.regenerate?(@path) + end + + should "regenerate if file is modified" do + @metadata.clear + @metadata.add(@path) + @metadata.metadata[@path]["mtime"] = Time.at(0) + @metadata.write + @metadata = Metadata.new(@site) + + assert_not_same File.mtime(@path), @metadata.metadata[@path]["mtime"] + assert @metadata.regenerate?(@path) + end + + should "regenerate if dependency is modified" do + @metadata.clear + @metadata.add(@path) + @metadata.write + @metadata = Metadata.new(@site) + + @metadata.add_dependency(@path, "new.dependency") + assert_equal ["new.dependency"], @metadata.metadata[@path]["deps"] + assert @metadata.regenerate?("new.dependency") + assert @metadata.regenerate?(@path) + end + + should "regenerate everything if metadata is disabled" do + @site.config["full_rebuild"] = true + @metadata.clear + @metadata.add(@path) + @metadata.write + @metadata = Metadata.new(@site) + + assert @metadata.regenerate?(@path) end end end From d0e12d69bc73346c156039e569b3d54d2e6ed806 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Fri, 28 Nov 2014 14:05:40 -0800 Subject: [PATCH 028/407] Last few revisions --- lib/jekyll/cleaner.rb | 2 +- lib/jekyll/configuration.rb | 1 + lib/jekyll/metadata.rb | 4 ++-- lib/jekyll/site.rb | 9 ++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 00191db79..bc5bd155f 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -13,7 +13,7 @@ module Jekyll # Cleans up the site's destination directory def cleanup! FileUtils.rm_rf(obsolete_files) - FileUtils.rm_rf(metadata_file) if @site.config["full_rebuild"] + FileUtils.rm_rf(metadata_file) if @site.full_rebuild? end private diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 7f1148a65..c64f3a898 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -22,6 +22,7 @@ module Jekyll 'encoding' => 'utf-8', 'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md', 'textile_ext' => 'textile', + 'full_rebuild' => false, # Filtering Content 'show_drafts' => nil, diff --git a/lib/jekyll/metadata.rb b/lib/jekyll/metadata.rb index 97fc0bf55..953dd7c0d 100644 --- a/lib/jekyll/metadata.rb +++ b/lib/jekyll/metadata.rb @@ -16,7 +16,7 @@ module Jekyll # # Returns true, also on failure. def add(path) - return true if not File.exist? path + return true unless File.exist?(path) metadata[path] = { "mtime" => File.mtime(path), @@ -100,7 +100,7 @@ module Jekyll # # Returns a Boolean (true for disabled, false for enabled). def disabled? - @disabled = site.config['full_rebuild'] if @disabled.nil? + @disabled = site.full_rebuild? if @disabled.nil? @disabled end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 4b8518c2b..7b8a4a00a 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -319,7 +319,7 @@ module Jekyll each_site_file { |item| item.write(dest) if item.regenerate? } - metadata.write unless config['full_rebuild'] + metadata.write unless full_rebuild? end # Construct a Hash of Posts indexed by the specified Post attribute. @@ -490,6 +490,13 @@ module Jekyll @frontmatter_defaults ||= FrontmatterDefaults.new(self) end + # Whether to perform a full rebuild without metadata + # + # Returns a Boolean: true for a full rebuild, false for normal build + def full_rebuild?(override = {}) + override['full_rebuild'] || config['full_rebuild'] + end + private def has_relative_page? From f8af94431d30fabb3d5df95434f329da85d1eb78 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Tue, 2 Dec 2014 20:50:39 -0600 Subject: [PATCH 029/407] Fix coverage reporting for built-in bundles --- test/helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index ea3777ed8..4b1fa7f8f 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,6 +1,9 @@ require 'simplecov' require 'simplecov-gem-adapter' -SimpleCov.start('gem') +SimpleCov.start('gem') do + add_filter "/vendor/bundle" + add_filter "/vendor/gem" +end require 'rubygems' require 'test/unit' From 52f0b36558e97712f5f0107fbc3b9fe6ac475c32 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Thu, 4 Dec 2014 20:09:49 -0800 Subject: [PATCH 030/407] Add incremental rebuild info to build command output --- lib/jekyll/commands/build.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index de2343287..11f1f75e4 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -50,8 +50,10 @@ module Jekyll def build(site, options) source = options['source'] destination = options['destination'] + full_build = options['full_rebuild'] Jekyll.logger.info "Source:", source Jekyll.logger.info "Destination:", destination + Jekyll.logger.info "Incremental build:", (full_build ? "disabled" : "enabled") Jekyll.logger.info "Generating..." process_site(site) Jekyll.logger.info "", "done." From f80dc07f82fcf5d17eeed32430d523912c462a75 Mon Sep 17 00:00:00 2001 From: Jordan Thornquest Date: Thu, 4 Dec 2014 21:54:02 -0700 Subject: [PATCH 031/407] add link to tutorial on building dynamic navbars --- site/_docs/resources.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/resources.md b/site/_docs/resources.md index cc95d0664..d4ca29a01 100644 --- a/site/_docs/resources.md +++ b/site/_docs/resources.md @@ -44,3 +44,4 @@ A guide to implementing a tag cloud and per-tag content pages using Jekyll. - A way to [extend Jekyll](https://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](https://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared. - [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll) +- [Using Jekyll’s Data Files to build a dynamic navbar](http://www.jordanthornque.st/blog/building-dynamic-navbars-with-jekyll/) From 9b6eeba81ec990ff145b30811b144875bd83e532 Mon Sep 17 00:00:00 2001 From: robschia Date: Sat, 6 Dec 2014 00:32:05 +0100 Subject: [PATCH 032/407] Added basic microdata --- lib/site_template/_layouts/post.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/site_template/_layouts/post.html b/lib/site_template/_layouts/post.html index a2b4e52fe..deeeb1f0a 100644 --- a/lib/site_template/_layouts/post.html +++ b/lib/site_template/_layouts/post.html @@ -1,14 +1,14 @@ --- layout: default --- -
+
>
-

{{ page.title }}

- +

{{ page.title }}

+
-
+
{{ content }}
From ed9cc80ff94889b9ee2ee461c1df647d06a719d7 Mon Sep 17 00:00:00 2001 From: robschia Date: Sat, 6 Dec 2014 00:49:04 +0100 Subject: [PATCH 033/407] Update post.html --- lib/site_template/_layouts/post.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/site_template/_layouts/post.html b/lib/site_template/_layouts/post.html index deeeb1f0a..ed4a98b16 100644 --- a/lib/site_template/_layouts/post.html +++ b/lib/site_template/_layouts/post.html @@ -1,7 +1,7 @@ --- layout: default --- -
> +

{{ page.title }}

From 5d9662f80f2aba39158cd26ea00216f4877e79a8 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Fri, 5 Dec 2014 19:07:18 -0800 Subject: [PATCH 034/407] Always regenerate asset files --- lib/jekyll/convertible.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index d6ddfde65..ada0fb8e6 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -172,7 +172,9 @@ module Jekyll # # Returns true if file needs to be regenerated def regenerate? - data['regenerate'] || site.metadata.regenerate?(site.in_source_dir(relative_path)) + asset_file? || + data['regenerate'] || + site.metadata.regenerate?(site.in_source_dir(relative_path)) end # Determine whether the file should be placed into layouts. From 43a28aed967b66de87e2a539ca92c5cb93ce9b66 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Fri, 5 Dec 2014 19:38:43 -0800 Subject: [PATCH 035/407] Fix indentation --- lib/jekyll/convertible.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index ada0fb8e6..eb96dd35c 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -173,8 +173,8 @@ module Jekyll # Returns true if file needs to be regenerated def regenerate? asset_file? || - data['regenerate'] || - site.metadata.regenerate?(site.in_source_dir(relative_path)) + data['regenerate'] || + site.metadata.regenerate?(site.in_source_dir(relative_path)) end # Determine whether the file should be placed into layouts. From 6deed4c66bc24fce350e1b0717e1055c6146437b Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Dec 2014 15:38:45 -0800 Subject: [PATCH 036/407] Update history to reflect merge of #3180 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index 225e60004..6210a20a5 100644 --- a/History.markdown +++ b/History.markdown @@ -13,6 +13,8 @@ ### Development Fixes + * Exclude built-in bundles from being added to coverage report (#3180) + ### Site Enhancements * Document the `-q` option for the `build` and `serve` commands (#3149) From 032139bd2f428e87f48ebe6c67f263144224343d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Dec 2014 16:08:16 -0800 Subject: [PATCH 037/407] Ensure only one converter is found for .Rmd in the tests. Ref: #3147. --- test/test_post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_post.rb b/test/test_post.rb index 65eaaf92c..2592b9185 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -680,8 +680,9 @@ class TestPost < Test::Unit::TestCase should "process .Rmd under text if it is not in the markdown config" do @site.config['markdown_ext'] = 'markdown,mkd,md,text' post = setup_post '2014-11-24-Rmd-extension.Rmd' + assert_equal 1, post.converters.size conv = post.converters.first - assert conv.kind_of? Jekyll::Converters::Identity + assert conv.kind_of?(Jekyll::Converters::Identity), "The converter for .Rmd should be the Identity converter." end should "process .text as textile under alternate configuration" do From e80469b7b01ed55144f9762fe4db52d2f35217c1 Mon Sep 17 00:00:00 2001 From: Joel Glovier Date: Mon, 8 Dec 2014 10:08:13 -0500 Subject: [PATCH 038/407] add in page nav to troubleshooting file --- site/_docs/troubleshooting.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site/_docs/troubleshooting.md b/site/_docs/troubleshooting.md index 14023094c..4bb12be83 100644 --- a/site/_docs/troubleshooting.md +++ b/site/_docs/troubleshooting.md @@ -11,6 +11,12 @@ that might be of help. If the problem you’re experiencing isn’t covered belo please [report an issue]({{site.help_url}}/issues/new) so the Jekyll community can make everyone’s experience better. +- [Installation Problems](#installation-problems) +- [Problems running Jekyll](#problems-running-jekyll) +- [Base-URL Problems](#base-url-problems) +- [Configuration problems](#configuration-problems) +- [Markup Problems](#markup-problems) + ## Installation Problems If you encounter errors during gem installation, you may need to install From 1694f8609c98ee2810316726ef13b13888dad820 Mon Sep 17 00:00:00 2001 From: Joel Glovier Date: Mon, 8 Dec 2014 10:08:54 -0500 Subject: [PATCH 039/407] update site dir readme Add some helpful info to the readme. --- site/README | 1 - site/README.md | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) delete mode 100644 site/README create mode 100644 site/README.md diff --git a/site/README b/site/README deleted file mode 100644 index 60b411cb6..000000000 --- a/site/README +++ /dev/null @@ -1 +0,0 @@ -Jekyll's awesome website. diff --git a/site/README.md b/site/README.md new file mode 100644 index 000000000..4e195caba --- /dev/null +++ b/site/README.md @@ -0,0 +1,11 @@ +# Jekyll docs site + +This directory contains the code for the Jekyll docs site, [jekyllrb.com](http://jekyllrb.com/). + +## Contributing + +For information about contributing, see the [Contributing page](http://jekyllrb.com/docs/contributing/). + +## Running locally + +You can preview your contributions before opening a pull request by running `jekyll serve` from within the directory. It's just a jekyll site, afterall! :wink: \ No newline at end of file From 12651c19e558b795f5b6fd3349f4987f471bb375 Mon Sep 17 00:00:00 2001 From: Joel Glovier Date: Mon, 8 Dec 2014 10:15:25 -0500 Subject: [PATCH 040/407] further clarify local dev steps --- site/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/README.md b/site/README.md index 4e195caba..df643719b 100644 --- a/site/README.md +++ b/site/README.md @@ -8,4 +8,8 @@ For information about contributing, see the [Contributing page](http://jekyllrb. ## Running locally -You can preview your contributions before opening a pull request by running `jekyll serve` from within the directory. It's just a jekyll site, afterall! :wink: \ No newline at end of file +You can preview your contributions before opening a pull request by running from within the directory: +1. `bundle install` +2. `jekyll serve` + +It's just a jekyll site, afterall! :wink: \ No newline at end of file From 59acdaab9a5270d8e97deaefb38ee185c8a19f4a Mon Sep 17 00:00:00 2001 From: robschia Date: Mon, 8 Dec 2014 19:46:49 +0100 Subject: [PATCH 041/407] Fixed itemprop="author name" You are right, I tried to oversimplify it. Also, {{ page.date | %Y-%m-%d }} doesn't output what I expected. I think it's fixed now, I tried the code with a couple of validators and everything seems fine. --- lib/site_template/_layouts/post.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/site_template/_layouts/post.html b/lib/site_template/_layouts/post.html index ed4a98b16..5a072b3ef 100644 --- a/lib/site_template/_layouts/post.html +++ b/lib/site_template/_layouts/post.html @@ -5,7 +5,7 @@ layout: default

{{ page.title }}

- +
From b735170ceb0a7b4b748f57f9af07bb0c826e7ed7 Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Tue, 9 Dec 2014 12:44:50 +0100 Subject: [PATCH 042/407] Jekyll-jalali plugin added to the plugins list. --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index a684bca54..c760fcfa9 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -533,6 +533,7 @@ You can find a few useful plugins at the following locations: - [jekyll-humanize](https://github.com/23maverick23/jekyll-humanize): This is a port of the Django app humanize which adds a "human touch" to data. Each method represents a Fluid type filter that can be used in your Jekyll site templates. Given that Jekyll produces static sites, some of the original methods do not make logical sense to port (e.g. naturaltime). - [Jekyll-Ordinal](https://github.com/PatrickC8t/Jekyll-Ordinal): Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th". - [Deprecated articles keeper](https://github.com/kzykbys/JekyllPlugins) by [Kazuya Kobayashi](http://blog.kazuya.co/): A simple Jekyll filter which monitor how old an article is. +- [Jekyll-jalali](https://github.com/mehdisadeghi/jekyll-jalali) by [Mehdi Sadeghi](http://mehdix.ir): A simple Gregorian to Jalali date converter filter. #### Tags From 383a0d0aa79405605ffb4638e85249778f6232a7 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Tue, 9 Dec 2014 07:42:00 -0500 Subject: [PATCH 043/407] modify as_liquid to use case statement --- lib/jekyll/filters.rb | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index e147c93e7..f92c02b11 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -327,21 +327,24 @@ module Jekyll end def as_liquid(item) - if item.class == Hash + case item + when Hash pairs = item.map { |k, v| as_liquid([k, v]) } Hash[pairs] - elsif item.class == Array + when Array item.map{ |i| as_liquid(i) } - elsif item.respond_to?(:to_liquid) - liquidated = item.to_liquid - # prevent infinite recursion for simple types (which return `self`) - if liquidated == item - item - else - as_liquid(liquidated) - end else - item + if item.respond_to?(:to_liquid) + liquidated = item.to_liquid + # prevent infinite recursion for simple types (which return `self`) + if liquidated == item + item + else + as_liquid(liquidated) + end + else + item + end end end end From 360412364ebe8ded02e3133598cc27c2d89d7921 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 9 Dec 2014 10:51:11 -0800 Subject: [PATCH 044/407] Update history to reflect merge of #3158 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 6210a20a5..172a2358d 100644 --- a/History.markdown +++ b/History.markdown @@ -10,6 +10,7 @@ * Fix `jsonify` Liquid filter handling of boolean values (#3154) * Add comma to value of `viewport` meta tag (#3170) * Set the link type for the RSS feed to `application/rss+xml` (#3176) + * Refactor `#as_liquid` (#3158) ### Development Fixes From 7656b9d2958492875fed92af62f1d08c82c9a09e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 9 Dec 2014 10:55:08 -0800 Subject: [PATCH 045/407] Update history to reflect merge of #3198 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 172a2358d..a06c9b8a4 100644 --- a/History.markdown +++ b/History.markdown @@ -24,6 +24,7 @@ * Repeat warning about cleaning of the `destination` directory (#3161) * Add jekyll-500px-embed to list of third-party plugins (#3163) * Simplified platform detection in Gemfile example for Windows (#3177) + * Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198) ## 2.5.2 / 2014-11-17 From f7891685220877be5e1073e35475319047d788b0 Mon Sep 17 00:00:00 2001 From: Joel Glovier Date: Tue, 9 Dec 2014 20:45:01 -0500 Subject: [PATCH 046/407] use rake instructions instead --- site/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/README.md b/site/README.md index df643719b..d98f6db7d 100644 --- a/site/README.md +++ b/site/README.md @@ -10,6 +10,6 @@ For information about contributing, see the [Contributing page](http://jekyllrb. You can preview your contributions before opening a pull request by running from within the directory: 1. `bundle install` -2. `jekyll serve` +2. `bundle exec rake site:preview` It's just a jekyll site, afterall! :wink: \ No newline at end of file From 5343fc3b544c5a0dfa785228888fcb8c15fb0de6 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 9 Dec 2014 18:10:02 -0800 Subject: [PATCH 047/407] Update history to reflect merge of #3196 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index a06c9b8a4..e06a3c15b 100644 --- a/History.markdown +++ b/History.markdown @@ -25,6 +25,7 @@ * Add jekyll-500px-embed to list of third-party plugins (#3163) * Simplified platform detection in Gemfile example for Windows (#3177) * Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198) + * Add Table of Contents to Troubleshooting page (#3196) ## 2.5.2 / 2014-11-17 From a069ad77c0b56bab861666d3e1c2811e1eac137b Mon Sep 17 00:00:00 2001 From: Benjamin Esham Date: Sun, 14 Dec 2014 15:36:59 -0500 Subject: [PATCH 048/407] Add link to inline_highlight plugin --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 95f57fb9c..33319bc9f 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -582,6 +582,7 @@ You can find a few useful plugins at the following locations: - [mathml.rb](https://github.com/tmthrgd/jekyll-plugins) by [Tom Thorogood](http://tomthorogood.co.uk/): A plugin to convert TeX mathematics into MathML for display. - [webmention_io.rb](https://github.com/aarongustafson/jekyll-webmention_io) by [Aaron Gustafson](http://aaron-gustafson.com/): A plugin to enable [webmention](http://indiewebcamp.com/webmention) integration using [Webmention.io](http://webmention.io). Includes an optional JavaScript for updating webmentions automatically between publishes and, if available, in realtime using WebSockets. - [Jekyll 500px Embed](https://github.com/lkorth/jekyll-500px-embed) by [Luke Korth](https://lukekorth.com/). A Liquid tag plugin that embeds [500px](https://500px.com/) photos. +- [inline\_highlight](https://github.com/bdesham/inline_highlight): A tag for inline syntax highlighting. #### Collections From 63ed3354639d65a7ea128dcb7b37f48a46c5c664 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 17 Dec 2014 19:00:57 -0800 Subject: [PATCH 049/407] Update history to reflect merge of #3212 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e06a3c15b..98ae4fe46 100644 --- a/History.markdown +++ b/History.markdown @@ -26,6 +26,7 @@ * Simplified platform detection in Gemfile example for Windows (#3177) * Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198) * Add Table of Contents to Troubleshooting page (#3196) + * Add `inline_highlight` plugin to list of third-party plugins (#3212) ## 2.5.2 / 2014-11-17 From 68a7ebf2eeae5248853cb9ef0256cc5c6d794272 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 17 Dec 2014 11:27:20 -0800 Subject: [PATCH 050/407] Add @alfredxing to the @jekyll/core team. --- ...12-17-alfredxing-welcome-to-jekyll-core.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md diff --git a/site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md b/site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md new file mode 100644 index 000000000..6d62c655e --- /dev/null +++ b/site/_posts/2014-12-17-alfredxing-welcome-to-jekyll-core.md @@ -0,0 +1,27 @@ +--- +layout: news_item +title: 'Alfred Xing has joined the Jekyll core team' +date: 2014-12-17 11:16:21 -0800 +author: parkr +version: alfredxing +categories: [team] +--- + +We're excited to announce that [@alfredxing][] has joined the @jekyll/core +team! + +He hails from Vancouver, BC, Canada, where he is studying Economics and +Computer Science at the [University of British Columbia][]. Alfred popped up in +the issues a few months ago with terrific insights, focus, and humility. +Performance buffs may be pleased to hear incremental regeneration will be +released in a future version of Jekyll -- a significant piece of the +feature written by Alfred. + +Please join me in welcoming Alfred to the Jekyll core team. We're excited +he's agreed to lend his talents to this project. The future is an exciting +place! + +Happy Jekylling! + +[@alfredxing]: https://github.com/alfredxing +[University of British Columbia]: http://ubc.ca From dc12bd3023b2b466ae9ca84433ec976c4761cdbc Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 18 Dec 2014 23:03:27 -0800 Subject: [PATCH 051/407] Update history to reflect merge of #3218 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 98ae4fe46..827289bfd 100644 --- a/History.markdown +++ b/History.markdown @@ -18,6 +18,7 @@ ### Site Enhancements + * Add `@alfredxing` to the `@jekyll/core` team. :tada: (#3218) * Document the `-q` option for the `build` and `serve` commands (#3149) * Fix some minor typos/flow fixes in documentation website content (#3165) * Add `keep_files` to configuration documentation (#3162) From d05df326b91af4a4f0b2a22576dd34b1a49b31d8 Mon Sep 17 00:00:00 2001 From: Jason Bellamy Date: Fri, 19 Dec 2014 22:55:40 -0500 Subject: [PATCH 052/407] Add jekyll-mermaid to the list of plugins. --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 33319bc9f..bd4396b3a 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -583,6 +583,7 @@ You can find a few useful plugins at the following locations: - [webmention_io.rb](https://github.com/aarongustafson/jekyll-webmention_io) by [Aaron Gustafson](http://aaron-gustafson.com/): A plugin to enable [webmention](http://indiewebcamp.com/webmention) integration using [Webmention.io](http://webmention.io). Includes an optional JavaScript for updating webmentions automatically between publishes and, if available, in realtime using WebSockets. - [Jekyll 500px Embed](https://github.com/lkorth/jekyll-500px-embed) by [Luke Korth](https://lukekorth.com/). A Liquid tag plugin that embeds [500px](https://500px.com/) photos. - [inline\_highlight](https://github.com/bdesham/inline_highlight): A tag for inline syntax highlighting. +- [jekyll-mermaid](https://github.com/jasonbellamy/jekyll-mermaid): Simplify the creation of mermaid diagrams and flowcharts in your posts and pages. #### Collections From c3e47437a3106162773f8532508a2bade29016b0 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 20 Dec 2014 10:45:15 -0800 Subject: [PATCH 053/407] Update history to reflect merge of #3222 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 827289bfd..82fe10e8e 100644 --- a/History.markdown +++ b/History.markdown @@ -28,6 +28,7 @@ * Add the `jekyll-jalali` plugin added to the list of third-party plugins. (#3198) * Add Table of Contents to Troubleshooting page (#3196) * Add `inline_highlight` plugin to list of third-party plugins (#3212) + * Add `jekyll-mermaid` plugin to list of third-party plugins (#3222) ## 2.5.2 / 2014-11-17 From aaf6f28fded9ec43e45ae023622fecf87640ac9c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 22 Dec 2014 08:58:29 -0500 Subject: [PATCH 054/407] Update history to reflect merge of #3116 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index 82fe10e8e..b51edd636 100644 --- a/History.markdown +++ b/History.markdown @@ -2,6 +2,8 @@ ### Major Enhancements + * Incremental regeneration (#3116) + ### Minor Enhancements ### Bug Fixes From 8284714d8a424aa583d53571d33861d50208d30a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 22 Dec 2014 09:15:57 -0500 Subject: [PATCH 055/407] Release :gem: 2.5.3 --- History.markdown | 8 +++ jekyll.gemspec | 64 +++++++++---------- lib/jekyll/version.rb | 2 +- site/_docs/history.md | 33 ++++++++++ .../2014-12-22-jekyll-2-5-3-released.markdown | 20 ++++++ site/latest_version.txt | 2 +- 6 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 site/_posts/2014-12-22-jekyll-2-5-3-released.markdown diff --git a/History.markdown b/History.markdown index 82fe10e8e..b526d5dc3 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,14 @@ ### Minor Enhancements +### Bug Fixes + +### Development Fixes + +### Site Enhancements + +## 2.5.3 / 2014-12-22 + ### Bug Fixes * When checking a Markdown extname, include position of the `.` (#3147) diff --git a/jekyll.gemspec b/jekyll.gemspec index 012ad01a7..b66243ce4 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -5,60 +5,60 @@ require 'jekyll/version' Gem::Specification.new do |s| s.specification_version = 2 if s.respond_to? :specification_version= - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= s.rubygems_version = '2.2.2' s.required_ruby_version = '>= 1.9.3' - s.name = 'jekyll' - s.version = Jekyll::VERSION - s.license = 'MIT' + s.name = 'jekyll' + s.version = Jekyll::VERSION + s.license = 'MIT' - s.summary = "A simple, blog aware, static site generator." - s.description = "Jekyll is a simple, blog aware, static site generator." + s.summary = 'A simple, blog aware, static site generator.' + s.description = 'Jekyll is a simple, blog aware, static site generator.' - s.authors = ["Tom Preston-Werner"] - s.email = 'tom@mojombo.com' - s.homepage = 'https://github.com/jekyll/jekyll' + s.authors = ['Tom Preston-Werner'] + s.email = 'tom@mojombo.com' + s.homepage = 'https://github.com/jekyll/jekyll' all_files = `git ls-files -z`.split("\x0") s.files = all_files.grep(%r{^(bin|lib)/}) s.executables = all_files.grep(%r{^bin/}) { |f| File.basename(f) } - s.require_paths = ["lib"] + s.require_paths = ['lib'] - s.rdoc_options = ["--charset=UTF-8"] + s.rdoc_options = ['--charset=UTF-8'] s.extra_rdoc_files = %w[README.markdown LICENSE] - s.add_runtime_dependency('liquid', "~> 2.6.1") - s.add_runtime_dependency('kramdown', "~> 1.3") - s.add_runtime_dependency('mercenary', "~> 0.3.3") - s.add_runtime_dependency('safe_yaml', "~> 1.0") - s.add_runtime_dependency('colorator', "~> 0.1") + s.add_runtime_dependency('liquid', '~> 2.6.1') + s.add_runtime_dependency('kramdown', '~> 1.3') + s.add_runtime_dependency('mercenary', '~> 0.3.3') + s.add_runtime_dependency('safe_yaml', '~> 1.0') + s.add_runtime_dependency('colorator', '~> 0.1') # Before 3.0 drops, phase the following gems out as dev dependencies # and gracefully handle their absence. - s.add_runtime_dependency('pygments.rb', "~> 0.6.0") - s.add_runtime_dependency('redcarpet', "~> 3.1") + s.add_runtime_dependency('pygments.rb', '~> 0.6.0') + s.add_runtime_dependency('redcarpet', '~> 3.1') s.add_runtime_dependency('toml', '~> 0.1.0') s.add_runtime_dependency('jekyll-paginate', '~> 1.0') s.add_runtime_dependency('jekyll-gist', '~> 1.0') s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0') s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0') s.add_runtime_dependency('jekyll-watch', '~> 1.1') - s.add_runtime_dependency('classifier-reborn', "~> 2.0") + s.add_runtime_dependency('classifier-reborn', '~> 2.0') - s.add_development_dependency('rake', "~> 10.1") - s.add_development_dependency('rdoc', "~> 3.11") - s.add_development_dependency('redgreen', "~> 1.2") - s.add_development_dependency('shoulda', "~> 3.5") - s.add_development_dependency('rr', "~> 1.1") - s.add_development_dependency('cucumber', "1.3.11") - s.add_development_dependency('RedCloth', "~> 4.2") - s.add_development_dependency('maruku', "~> 0.7.0") - s.add_development_dependency('rdiscount', "~> 1.6") - s.add_development_dependency('launchy', "~> 2.3") - s.add_development_dependency('simplecov', "~> 0.9") - s.add_development_dependency('simplecov-gem-adapter', "~> 1.0.1") - s.add_development_dependency('mime-types', "~> 1.5") + s.add_development_dependency('rake', '~> 10.1') + s.add_development_dependency('rdoc', '~> 3.11') + s.add_development_dependency('redgreen', '~> 1.2') + s.add_development_dependency('shoulda', '~> 3.5') + s.add_development_dependency('rr', '~> 1.1') + s.add_development_dependency('cucumber', '1.3.11') + s.add_development_dependency('RedCloth', '~> 4.2') + s.add_development_dependency('maruku', '~> 0.7.0') + s.add_development_dependency('rdiscount', '~> 1.6') + s.add_development_dependency('launchy', '~> 2.3') + s.add_development_dependency('simplecov', '~> 0.9') + s.add_development_dependency('simplecov-gem-adapter', '~> 1.0.1') + s.add_development_dependency('mime-types', '~> 1.5') s.add_development_dependency('activesupport', '~> 3.2.13') s.add_development_dependency('jekyll_test_plugin') s.add_development_dependency('jekyll_test_plugin_malicious') diff --git a/lib/jekyll/version.rb b/lib/jekyll/version.rb index 4df111605..91ff7408f 100644 --- a/lib/jekyll/version.rb +++ b/lib/jekyll/version.rb @@ -1,3 +1,3 @@ module Jekyll - VERSION = '2.5.2' + VERSION = '2.5.3' end diff --git a/site/_docs/history.md b/site/_docs/history.md index 036a4c999..6485dadae 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -5,6 +5,39 @@ permalink: "/docs/history/" prev_section: contributing --- +## 2.5.3 / 2014-12-22 +{: #v2-5-3} + +### Bug Fixes +{: #bug-fixes-v2-5-3} + +- When checking a Markdown extname, include position of the `.` ([#3147]({{ site.repository }}/issues/3147)) +- Fix `jsonify` Liquid filter handling of boolean values ([#3154]({{ site.repository }}/issues/3154)) +- Add comma to value of `viewport` meta tag ([#3170]({{ site.repository }}/issues/3170)) +- Set the link type for the RSS feed to `application/rss+xml` ([#3176]({{ site.repository }}/issues/3176)) +- Refactor `#as_liquid` ([#3158]({{ site.repository }}/issues/3158)) + +### Development Fixes +{: #development-fixes-v2-5-3} + +- Exclude built-in bundles from being added to coverage report ([#3180]({{ site.repository }}/issues/3180)) + +### Site Enhancements +{: #site-enhancements-v2-5-3} + +- Add `[@alfredxing](https://github.com/alfredxing)` to the `[@jekyll](https://github.com/jekyll)/core` team. :tada: ([#3218]({{ site.repository }}/issues/3218)) +- Document the `-q` option for the `build` and `serve` commands ([#3149]({{ site.repository }}/issues/3149)) +- Fix some minor typos/flow fixes in documentation website content ([#3165]({{ site.repository }}/issues/3165)) +- Add `keep_files` to configuration documentation ([#3162]({{ site.repository }}/issues/3162)) +- Repeat warning about cleaning of the `destination` directory ([#3161]({{ site.repository }}/issues/3161)) +- Add jekyll-500px-embed to list of third-party plugins ([#3163]({{ site.repository }}/issues/3163)) +- Simplified platform detection in Gemfile example for Windows ([#3177]({{ site.repository }}/issues/3177)) +- Add the `jekyll-jalali` plugin added to the list of third-party plugins. ([#3198]({{ site.repository }}/issues/3198)) +- Add Table of Contents to Troubleshooting page ([#3196]({{ site.repository }}/issues/3196)) +- Add `inline_highlight` plugin to list of third-party plugins ([#3212]({{ site.repository }}/issues/3212)) +- Add `jekyll-mermaid` plugin to list of third-party plugins ([#3222]({{ site.repository }}/issues/3222)) + + ## 2.5.2 / 2014-11-17 {: #v2-5-2} diff --git a/site/_posts/2014-12-22-jekyll-2-5-3-released.markdown b/site/_posts/2014-12-22-jekyll-2-5-3-released.markdown new file mode 100644 index 000000000..7743fd8ed --- /dev/null +++ b/site/_posts/2014-12-22-jekyll-2-5-3-released.markdown @@ -0,0 +1,20 @@ +--- +layout: news_item +title: 'Jekyll Release for the Holidays! v2.5.3 Out' +date: 2014-12-22 09:03:30 -0500 +author: parkr +version: 2.5.3 +categories: [release] +--- + +Happy Holidays, everyone. + +Jekyll v2.5.3 is a quick patch release, containing some minor fixes. See the +[full history](/docs/history/) for more info. If you notice any problems, +please [let us know]({{ site.help_url }}). + +This release also marks the start of Jekyll 3 development. I wrote about it +over on my personal blog: [Jekyll 3 — The Road Ahead](https://byparker.com/blog/2014/jekyll-3-the-road-ahead/). +Feel free to chime in over on GitHub. + +Happy Jekylling! diff --git a/site/latest_version.txt b/site/latest_version.txt index 21b159dc8..a4db534a2 100644 --- a/site/latest_version.txt +++ b/site/latest_version.txt @@ -1 +1 @@ -2.5.2 \ No newline at end of file +2.5.3 \ No newline at end of file From 922ba5d0ea3b3539a7c01eff248160fe14f4d399 Mon Sep 17 00:00:00 2001 From: Fonso Date: Tue, 23 Dec 2014 13:26:08 +0100 Subject: [PATCH 056/407] Fixing the default host on docs --- site/_docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index e1d176fac..e4d555245 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -497,7 +497,7 @@ excerpt_separator: "\n\n" # Serving detach: false port: 4000 -host: 0.0.0.0 +host: 127.0.0.1 baseurl: "" # does not include hostname # Backwards-compatibility From f3a274377a54257bc1868f867c8ad32903105238 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 23 Dec 2014 16:49:43 -0500 Subject: [PATCH 057/407] Update history to reflect merge of #3229 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index f6a7bd146..3cd9d6373 100644 --- a/History.markdown +++ b/History.markdown @@ -12,6 +12,8 @@ ### Site Enhancements + * Fixing the default host on docs (#3229) + ## 2.5.3 / 2014-12-22 ### Bug Fixes From 52085d2e34d2f5a7b6797462def6370726de357c Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Wed, 24 Dec 2014 16:14:08 -0600 Subject: [PATCH 058/407] Fix a few punctuation errors --- site/_docs/pages.md | 2 +- site/_docs/plugins.md | 8 ++++---- site/_docs/templates.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/site/_docs/pages.md b/site/_docs/pages.md index e7b837fab..ea59649e9 100644 --- a/site/_docs/pages.md +++ b/site/_docs/pages.md @@ -60,7 +60,7 @@ and associated URLs might look like: ### Named folders containing index HTML files -There is nothing wrong with the above method, however some people like to keep +There is nothing wrong with the above method. However, some people like to keep their URLs free from things like filename extensions. To achieve clean URLs for pages using Jekyll, you simply need to create a folder for each top-level page you want, and then place an `index.html` file in each page’s folder. This way diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index bd4396b3a..9b68e17b6 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -13,8 +13,8 @@ having to modify the Jekyll source itself.
Plugins on GitHub Pages

- GitHub Pages is powered by Jekyll, - however all Pages sites are generated using the --safe option + GitHub Pages is powered by Jekyll. + However, all Pages sites are generated using the --safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.

You can still use GitHub Pages to publish your site, but you’ll need to @@ -68,8 +68,8 @@ A generator is a subclass of `Jekyll::Generator` that defines a `generate` method, which receives an instance of [`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). -Generation is triggered for its side-effects, the return value of `generate` is -ignored. Jekyll does not assume any particular side-effect to happen, it just +Because generation is triggered for its side effects, the return value of `generate` is +ignored. Jekyll does not assume any particular side effect to happen---it just runs the method. Generators run after Jekyll has made an inventory of the existing content, and diff --git a/site/_docs/templates.md b/site/_docs/templates.md index 2cd7461d7..c0825702f 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -303,7 +303,7 @@ You can also choose to include file fragments relative to the current file: You won't need to place your included content within the `_includes` directory. Instead, the inclusion is specifically relative to the file where the tag is being used. For example, if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file -must be within the `_posts` directory, or one of it's subdirectories. You cannot include +must be within the `_posts` directory, or one of its subdirectories. You cannot include files in other locations. All the other capabilities of the `include` tag are available to the `include_relative` tag, From d6995d347a46af1e15508bc623572edb553eddf4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 16:00:59 -0500 Subject: [PATCH 059/407] Drop support for Ruby 1.9.3. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 90e08adff..72f0752d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ sudo: false rvm: - 2.1 - 2.0 -- 1.9.3 env: matrix: - TEST_SUITE=test From 6e4e290ab0569a7a84c1d88f558c58340ce4661a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 16:11:14 -0500 Subject: [PATCH 060/407] Requires >= 2.0.0 --- jekyll.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll.gemspec b/jekyll.gemspec index b66243ce4..4913951ef 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |s| s.specification_version = 2 if s.respond_to? :specification_version= s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= s.rubygems_version = '2.2.2' - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.0.0' s.name = 'jekyll' s.version = Jekyll::VERSION From 4070143d5b06965a764fc655c7787013c80d040b Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Thu, 25 Dec 2014 15:17:21 -0600 Subject: [PATCH 061/407] Tweak sentence structure --- site/_docs/plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 9b68e17b6..605cbf684 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -68,9 +68,9 @@ A generator is a subclass of `Jekyll::Generator` that defines a `generate` method, which receives an instance of [`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). -Because generation is triggered for its side effects, the return value of `generate` is -ignored. Jekyll does not assume any particular side effect to happen---it just -runs the method. +The return value of `generate` is ignored, since generation is triggered for +its side effects. Jekyll does not expect any particular side effect to +happen---it just runs the method. Generators run after Jekyll has made an inventory of the existing content, and before the site is generated. Pages with YAML Front Matters are stored as From b1a517ccb65833ff9250b3ae9fa13794c86f9951 Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Thu, 25 Dec 2014 18:29:50 -0600 Subject: [PATCH 062/407] Remove unnecessary 'where' --- site/_docs/pagination.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/pagination.md b/site/_docs/pagination.md index 3bb7d1398..245ba36f3 100644 --- a/site/_docs/pagination.md +++ b/site/_docs/pagination.md @@ -32,7 +32,7 @@ paginate: 5 The number should be the maximum number of Posts you’d like to be displayed per- page in the generated site. -You may also specify where the destination of the pagination pages: +You may also specify the destination of the pagination pages: {% highlight yaml %} paginate_path: "blog/page:num/" From 0aa61f66a83fe4aafef65f7abcd103e0a8088886 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 26 Dec 2014 12:10:03 +0100 Subject: [PATCH 063/407] Remove unneeded end tag --- lib/site_template/_includes/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/site_template/_includes/head.html b/lib/site_template/_includes/head.html index 47057b504..41340ae57 100644 --- a/lib/site_template/_includes/head.html +++ b/lib/site_template/_includes/head.html @@ -8,5 +8,5 @@ - + From 82b1ad0552202a50e9f9a35a392236adc469502d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 16:35:56 -0500 Subject: [PATCH 064/407] Update history to reflect merge of #3236 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index 3cd9d6373..2dca27a5c 100644 --- a/History.markdown +++ b/History.markdown @@ -8,6 +8,8 @@ ### Bug Fixes + * Remove unneeded end tag for `link` in site template (#3236) + ### Development Fixes ### Site Enhancements From 323404151001de486bacccc7e11c91676144ad26 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 16:46:57 -0500 Subject: [PATCH 065/407] Update history to reflect merge of #3235 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 2dca27a5c..892800991 100644 --- a/History.markdown +++ b/History.markdown @@ -3,6 +3,7 @@ ### Major Enhancements * Incremental regeneration (#3116) + * Drop support for Ruby 1.9.3. (#3235) ### Minor Enhancements From 5bf15964140c767b5011f1ee65d5a4f8e7a05231 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 14 Oct 2014 12:04:09 -0700 Subject: [PATCH 066/407] Refactor Highlight tag tests to use a helper method to create the tag. --- Gemfile | 1 + jekyll.gemspec | 2 +- test/test_tags.rb | 40 +++++++++++++++++++++++++++++----------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 25b40ed2e..d680ef693 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gemspec +gem "liquid", github: 'Shopify/liquid' if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/jekyll.gemspec b/jekyll.gemspec index 4913951ef..c9876c47e 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.rdoc_options = ['--charset=UTF-8'] s.extra_rdoc_files = %w[README.markdown LICENSE] - s.add_runtime_dependency('liquid', '~> 2.6.1') + #s.add_runtime_dependency('liquid', '') s.add_runtime_dependency('kramdown', '~> 1.3') s.add_runtime_dependency('mercenary', '~> 0.3.3') s.add_runtime_dependency('safe_yaml', '~> 1.0') diff --git a/test/test_tags.rb b/test/test_tags.rb index a47ca897d..bc4b48cd7 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -43,6 +43,10 @@ CONTENT create_post(content, override) end + def highlight_block_with_opts(options_string) + Jekyll::Tags::HighlightBlock.parse('highlight', options_string, ["test", "{% endhighlight %}", "\n"], {}) + end + context "language name" do should "match only the required set of chars" do r = Jekyll::Tags::HighlightBlock::SYNTAX @@ -59,37 +63,51 @@ CONTENT end end - context "initialized tag" do - should "set the correct options" do - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby ', ["test", "{% endhighlight %}", "\n"]) + context "highlight tag in unsafe mode" do + should "set the no options with just a language name" do + tag = highlight_block_with_opts('ruby ') assert_equal({}, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos ', ["test", "{% endhighlight %}", "\n"]) + should "set the linenos option as 'inline' if no linenos value" do + tag = highlight_block_with_opts('ruby linenos ') assert_equal({ :linenos => 'inline' }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table ', ["test", "{% endhighlight %}", "\n"]) + should "set the linenos option to 'table' if the linenos key is given the table value" do + tag = highlight_block_with_opts('ruby linenos=table ') assert_equal({ :linenos => 'table' }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table nowrap', ["test", "{% endhighlight %}", "\n"]) + should "recognize nowrap option with linenos set" do + tag = highlight_block_with_opts('ruby linenos=table nowrap ') assert_equal({ :linenos => 'table', :nowrap => true }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"]) + should "recognize the cssclass option" do + tag = highlight_block_with_opts('ruby linenos=table cssclass=hl ') assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos=3', ["test", "{% endhighlight %}", "\n"]) + should "recognize the hl_linenos option and its value" do + tag = highlight_block_with_opts('ruby linenos=table cssclass=hl hl_linenos=3 ') assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => '3' }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos="3 5 6"', ["test", "{% endhighlight %}", "\n"]) + should "recognize multiple values of hl_linenos" do + tag = highlight_block_with_opts('ruby linenos=table cssclass=hl hl_linenos="3 5 6" ') assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => ['3', '5', '6'] }, tag.instance_variable_get(:@options)) + end - tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"]) + should "treat language name as case insensitive" do + tag = highlight_block_with_opts('Ruby ') assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive" end end context "in safe mode" do setup do - @tag = Jekyll::Tags::HighlightBlock.new('highlight', 'text ', ["test", "{% endhighlight %}", "\n"]) + @tag = highlight_block_with_opts('text ') end should "allow linenos" do From 70a331d8547e79454cdbc2e27da392cea30c499b Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 29 Oct 2014 15:04:35 -0700 Subject: [PATCH 067/407] Set the error mode to :strict --- Gemfile | 2 +- lib/jekyll.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d680ef693..7c91f2620 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' gemspec -gem "liquid", github: 'Shopify/liquid' +gem "liquid", github: 'Shopify/liquid', branch: '3-0-0-rc1' if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 911b3ddbf..45c9a4d56 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -30,6 +30,7 @@ require 'kramdown' require 'colorator' SafeYAML::OPTIONS[:suppress_warnings] = true +Liquid::Template.error_mode = :strict module Jekyll From 3940e1e9df2573a8ad26727360213c94edd6ca04 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 12 Nov 2014 16:00:26 -0800 Subject: [PATCH 068/407] Bump to Liquid 3.0 --- Gemfile | 1 - jekyll.gemspec | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 7c91f2620..25b40ed2e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source 'https://rubygems.org' gemspec -gem "liquid", github: 'Shopify/liquid', branch: '3-0-0-rc1' if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/jekyll.gemspec b/jekyll.gemspec index c9876c47e..a7bd0d5bf 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.rdoc_options = ['--charset=UTF-8'] s.extra_rdoc_files = %w[README.markdown LICENSE] - #s.add_runtime_dependency('liquid', '') + s.add_runtime_dependency('liquid', '~> 3.0') s.add_runtime_dependency('kramdown', '~> 1.3') s.add_runtime_dependency('mercenary', '~> 0.3.3') s.add_runtime_dependency('safe_yaml', '~> 1.0') From b68dd3a5cb8366507c80c37c3ac1f13c71a498c1 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 15 Dec 2014 16:27:24 -0800 Subject: [PATCH 069/407] Add liquid c if it's available. --- jekyll.gemspec | 1 + lib/jekyll.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/jekyll.gemspec b/jekyll.gemspec index a7bd0d5bf..9631b3488 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -63,6 +63,7 @@ Gem::Specification.new do |s| s.add_development_dependency('jekyll_test_plugin') s.add_development_dependency('jekyll_test_plugin_malicious') s.add_development_dependency('rouge', '~> 1.7') + s.add_development_dependency('liquid-c', '~> 0.0.2') s.add_development_dependency('minitest') if RUBY_PLATFORM =~ /cygwin/ s.add_development_dependency('test-unit') if RUBY_PLATFORM =~ /cygwin/ end diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 45c9a4d56..bde115815 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -29,6 +29,12 @@ require 'liquid' require 'kramdown' require 'colorator' +# Conditional optimizations +begin + require 'liquid-c' +rescue LoadError +end + SafeYAML::OPTIONS[:suppress_warnings] = true Liquid::Template.error_mode = :strict From 8bfc696569057955dbeeb4fe6e0652d0189c163c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 14:42:15 -0500 Subject: [PATCH 070/407] liquid-c 0.0.3 --- jekyll.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jekyll.gemspec b/jekyll.gemspec index 9631b3488..7d0a97fc5 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -63,7 +63,7 @@ Gem::Specification.new do |s| s.add_development_dependency('jekyll_test_plugin') s.add_development_dependency('jekyll_test_plugin_malicious') s.add_development_dependency('rouge', '~> 1.7') - s.add_development_dependency('liquid-c', '~> 0.0.2') + s.add_development_dependency('liquid-c', '~> 0.0.3') s.add_development_dependency('minitest') if RUBY_PLATFORM =~ /cygwin/ s.add_development_dependency('test-unit') if RUBY_PLATFORM =~ /cygwin/ end From 3957efac15551d3916e7e9dc63a17c5fd3c0717a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:00:45 -0500 Subject: [PATCH 071/407] Update history to reflect merge of #3002 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 892800991..57b63380a 100644 --- a/History.markdown +++ b/History.markdown @@ -4,6 +4,7 @@ * Incremental regeneration (#3116) * Drop support for Ruby 1.9.3. (#3235) + * Upgrade to Liquid 3.0.0 (#3002) ### Minor Enhancements From a103898980dd40d32b1516c34f12f52c9d0b4e9f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:16:33 -0500 Subject: [PATCH 072/407] Set 'use_coderay' to 'enable_coderay' --- lib/jekyll/configuration.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index c64f3a898..377e799b4 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -75,12 +75,12 @@ module Jekyll }, 'kramdown' => { - 'auto_ids' => true, - 'footnote_nr' => 1, - 'entity_output' => 'as_char', - 'toc_levels' => '1..6', - 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo', - 'use_coderay' => false, + 'auto_ids' => true, + 'footnote_nr' => 1, + 'entity_output' => 'as_char', + 'toc_levels' => '1..6', + 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo', + 'enable_coderay' => false, 'coderay' => { 'coderay_wrap' => 'div', From f6bff6fb614d9ad04119fd99ad8dd55c14bee0c3 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:16:47 -0500 Subject: [PATCH 073/407] Have a deprecation fallback for 'use_coderay' --- lib/jekyll/configuration.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 377e799b4..7ba9359b2 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -254,6 +254,12 @@ module Jekyll config[option].map!(&:to_s) end + if (config['kramdown'] || {}).key?('use_coderay') + Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" + + " to 'enable_coderay' in your configuration file." + config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay') + end + if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku") Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " + "Markdown processor. Maruku support has been deprecated and will " + From d35af9c1f36c9189bb4c6970c7c75d102fbf7a21 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:16:57 -0500 Subject: [PATCH 074/407] Read 'enable_coderay' in the Kramdown parser --- lib/jekyll/converters/markdown/kramdown_parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb index 097c9212a..a9dbec96f 100644 --- a/lib/jekyll/converters/markdown/kramdown_parser.rb +++ b/lib/jekyll/converters/markdown/kramdown_parser.rb @@ -13,14 +13,14 @@ module Jekyll def convert(content) # Check for use of coderay - if @config['kramdown']['use_coderay'] + if @config['kramdown']['enable_coderay'] %w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt| key = "coderay_#{opt}" @config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key) end end - Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config["kramdown"])).to_html + Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config['kramdown'])).to_html end end From 039c521e8c85d8f774fe0ab4498c9c258c7e599d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:17:07 -0500 Subject: [PATCH 075/407] Update the documentation. --- site/_docs/configuration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index e4d555245..c9ddd915f 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -527,12 +527,12 @@ redcarpet: extensions: [] kramdown: - auto_ids: true - footnote_nr: 1 - entity_output: as_char - toc_levels: 1..6 - smart_quotes: lsquo,rsquo,ldquo,rdquo - use_coderay: false + auto_ids: true + footnote_nr: 1 + entity_output: as_char + toc_levels: 1..6 + smart_quotes: lsquo,rsquo,ldquo,rdquo + enable_coderay: false coderay: coderay_wrap: div From c24c6b7f3d2607cb6b7e138c66e504d43e73da63 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:17:33 -0500 Subject: [PATCH 076/407] Use 'enable_coderay' in the tests. --- test/test_kramdown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index f2bd8a0b7..3998e9d3f 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -14,7 +14,7 @@ class TestKramdown < Test::Unit::TestCase 'toc_levels' => '1..6', 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo', - 'use_coderay' => true, + 'enable_coderay' => true, 'coderay_bold_every'=> 12, 'coderay' => { 'coderay_css' => :style, From e120c255ff8c8c5e29c79d9e908781b076306ce3 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:22:36 -0500 Subject: [PATCH 077/407] Update history to reflect merge of #3237 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 57b63380a..eea85f4af 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ ### Bug Fixes * Remove unneeded end tag for `link` in site template (#3236) + * Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237) ### Development Fixes From 0eb2796a66ba1d7fab243c34e55f285b9fbec766 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 11 Dec 2014 12:48:57 -0800 Subject: [PATCH 078/407] Sort static files just once. Ref: #2075. --- lib/jekyll/site.rb | 3 ++- lib/jekyll/static_file.rb | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 7b8a4a00a..3ddda4749 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -187,6 +187,7 @@ module Jekyll end pages.sort_by!(&:name) + static_files.sort_by!(&:relative_path) end # Read all the files in /

/_posts and create a new Post @@ -384,7 +385,7 @@ module Jekyll "time" => time, "posts" => posts.sort { |a, b| b <=> a }, "pages" => pages, - "static_files" => static_files.sort { |a, b| a.relative_path <=> b.relative_path }, + "static_files" => static_files, "html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") }, "categories" => post_attr_hash('categories'), "tags" => post_attr_hash('tags'), diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 8e1006562..02500b1d5 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -3,6 +3,8 @@ module Jekyll # The cache of last modification times [path] -> mtime. @@mtimes = Hash.new + attr_reader :relative_path + # Initialize a new StaticFile. # # site - The Site. @@ -15,6 +17,7 @@ module Jekyll @dir = dir @name = name @collection = collection + @relative_path = File.join(*[@dir, @name].compact) end # Returns source file path. @@ -22,11 +25,6 @@ module Jekyll File.join(*[@base, @dir, @name].compact) end - # Returns the source file path relative to the site source - def relative_path - @relative_path ||= File.join(*[@dir, @name].compact) - end - def extname File.extname(path) end From 2f8248a6f17f0dffb3b504aff165e25c9039666e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 18 Dec 2014 00:10:20 -0800 Subject: [PATCH 079/407] Only call #site_payload once for all collection work. --- lib/jekyll/renderer.rb | 7 ++++--- lib/jekyll/site.rb | 3 ++- test/test_deprecator.rb | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 test/test_deprecator.rb diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index 1cdf6c2aa..3e66bce6d 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -3,11 +3,12 @@ module Jekyll class Renderer - attr_reader :document, :site + attr_reader :document, :site, :payload - def initialize(site, document) + def initialize(site, document, payload = nil) @site = site @document = document + @payload = payload end # Determine which converters to use based on this document's @@ -32,7 +33,7 @@ module Jekyll def run payload = Utils.deep_merge_hashes({ "page" => document.to_liquid - }, site.site_payload) + }, payload || site.site_payload) info = { filters: [Jekyll::Filters], diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 3ddda4749..85c479bf6 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -292,9 +292,10 @@ module Jekyll def render relative_permalinks_deprecation_method + payload = site_payload collections.each do |label, collection| collection.docs.each do |document| - document.output = Jekyll::Renderer.new(self, document).run if document.regenerate? + document.output = Jekyll::Renderer.new(self, document, payload).run if document.regenerate? end end diff --git a/test/test_deprecator.rb b/test/test_deprecator.rb new file mode 100644 index 000000000..7be838d24 --- /dev/null +++ b/test/test_deprecator.rb @@ -0,0 +1,6 @@ +require 'helper' + +class TestDeprecator < Test::Unit::TestCase + def test_no_subcommand + end +end From a8ec9cd5075b79a64a91ecdc6379564023d80d31 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 22:37:56 -0500 Subject: [PATCH 080/407] Put the development dependencies in the Gemfile directly. --- Gemfile | 21 +++++++++++++++++++++ jekyll.gemspec | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 25b40ed2e..c79afe7ce 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,27 @@ source 'https://rubygems.org' gemspec +gem 'rake', '~> 10.1' +gem 'rdoc', '~> 3.11' +gem 'redgreen', '~> 1.2' +gem 'shoulda', '~> 3.5' +gem 'rr', '~> 1.1' +gem 'cucumber', '1.3.11' +gem 'RedCloth', '~> 4.2' +gem 'maruku', '~> 0.7.0' +gem 'rdiscount', '~> 1.6' +gem 'launchy', '~> 2.3' +gem 'simplecov', '~> 0.9' +gem 'simplecov-gem-adapter', '~> 1.0.1' +gem 'mime-types', '~> 1.5' +gem 'activesupport', '~> 3.2.13' +gem 'jekyll_test_plugin' +gem 'jekyll_test_plugin_malicious' +gem 'rouge', '~> 1.7' +gem 'liquid-c', '~> 0.0.3' +gem 'minitest' if RUBY_PLATFORM =~ /cygwin/ +gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ + if ENV['BENCHMARK'] gem 'rbtrace' gem 'stackprof' diff --git a/jekyll.gemspec b/jekyll.gemspec index 7d0a97fc5..8a7e19fec 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -45,25 +45,4 @@ Gem::Specification.new do |s| s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0') s.add_runtime_dependency('jekyll-watch', '~> 1.1') s.add_runtime_dependency('classifier-reborn', '~> 2.0') - - s.add_development_dependency('rake', '~> 10.1') - s.add_development_dependency('rdoc', '~> 3.11') - s.add_development_dependency('redgreen', '~> 1.2') - s.add_development_dependency('shoulda', '~> 3.5') - s.add_development_dependency('rr', '~> 1.1') - s.add_development_dependency('cucumber', '1.3.11') - s.add_development_dependency('RedCloth', '~> 4.2') - s.add_development_dependency('maruku', '~> 0.7.0') - s.add_development_dependency('rdiscount', '~> 1.6') - s.add_development_dependency('launchy', '~> 2.3') - s.add_development_dependency('simplecov', '~> 0.9') - s.add_development_dependency('simplecov-gem-adapter', '~> 1.0.1') - s.add_development_dependency('mime-types', '~> 1.5') - s.add_development_dependency('activesupport', '~> 3.2.13') - s.add_development_dependency('jekyll_test_plugin') - s.add_development_dependency('jekyll_test_plugin_malicious') - s.add_development_dependency('rouge', '~> 1.7') - s.add_development_dependency('liquid-c', '~> 0.0.3') - s.add_development_dependency('minitest') if RUBY_PLATFORM =~ /cygwin/ - s.add_development_dependency('test-unit') if RUBY_PLATFORM =~ /cygwin/ end From b6641be8ef2f96e42c0a17dd5bb68cbaf4dc0b6f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 18 Dec 2014 00:11:44 -0800 Subject: [PATCH 081/407] Call it site_payload instead of payload. --- lib/jekyll/renderer.rb | 12 ++++++------ test/test_deprecator.rb | 6 ------ 2 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 test/test_deprecator.rb diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index 3e66bce6d..e0701fd5f 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -3,12 +3,12 @@ module Jekyll class Renderer - attr_reader :document, :site, :payload + attr_reader :document, :site, :site_payload - def initialize(site, document, payload = nil) - @site = site - @document = document - @payload = payload + def initialize(site, document, site_payload = nil) + @site = site + @document = document + @site_payload = site_payload end # Determine which converters to use based on this document's @@ -33,7 +33,7 @@ module Jekyll def run payload = Utils.deep_merge_hashes({ "page" => document.to_liquid - }, payload || site.site_payload) + }, site_payload || site.site_payload) info = { filters: [Jekyll::Filters], diff --git a/test/test_deprecator.rb b/test/test_deprecator.rb deleted file mode 100644 index 7be838d24..000000000 --- a/test/test_deprecator.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'helper' - -class TestDeprecator < Test::Unit::TestCase - def test_no_subcommand - end -end From 657b16519ef13cce2772aa45df96287aa5df27ef Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 26 Dec 2014 23:10:21 -0500 Subject: [PATCH 082/407] Update history to reflect merge of #3204 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index eea85f4af..eb3780764 100644 --- a/History.markdown +++ b/History.markdown @@ -8,6 +8,8 @@ ### Minor Enhancements + * Sort static files just once, and call `site_payload` once for all collections (#3204) + ### Bug Fixes * Remove unneeded end tag for `link` in site template (#3236) From 0c0aea3ad7d2605325d420a23d21729c5cf7cf88 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 14:12:09 -0500 Subject: [PATCH 083/407] Improve Site#getConverterImpl and call it Site#find_converter_instance --- lib/jekyll/filters.rb | 8 ++++---- lib/jekyll/site.rb | 9 ++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index f92c02b11..17a4142b4 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -10,7 +10,7 @@ module Jekyll # Returns the HTML formatted String. def textilize(input) site = @context.registers[:site] - converter = site.getConverterImpl(Jekyll::Converters::Textile) + converter = site.find_converter_instance(Jekyll::Converters::Textile) converter.convert(input) end @@ -21,7 +21,7 @@ module Jekyll # Returns the HTML formatted String. def markdownify(input) site = @context.registers[:site] - converter = site.getConverterImpl(Jekyll::Converters::Markdown) + converter = site.find_converter_instance(Jekyll::Converters::Markdown) converter.convert(input) end @@ -32,7 +32,7 @@ module Jekyll # Returns the CSS formatted String. def sassify(input) site = @context.registers[:site] - converter = site.getConverterImpl(Jekyll::Converters::Sass) + converter = site.find_converter_instance(Jekyll::Converters::Sass) converter.convert(input) end @@ -43,7 +43,7 @@ module Jekyll # Returns the CSS formatted String. def scssify(input) site = @context.registers[:site] - converter = site.getConverterImpl(Jekyll::Converters::Scss) + converter = site.find_converter_instance(Jekyll::Converters::Scss) converter.convert(input) end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 85c479bf6..83ab283c5 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -414,13 +414,8 @@ module Jekyll # klass - The Class of the Converter to fetch. # # Returns the Converter instance implementing the given Converter. - def getConverterImpl(klass) - matches = converters.select { |c| c.class == klass } - if impl = matches.first - impl - else - raise "Converter implementation not found for #{klass}" - end + def find_converter_instance(klass) + converters.find { |c| c.class == klass } || proc { raise "No converter for #{klass}" }.call end # Create array of instances of the subclasses of the class or module From 232a58d5b43a257a338141c6e9a20d4006b2d101 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 14:14:24 -0500 Subject: [PATCH 084/407] Fix test use of Site#getConverterImpl. --- test/test_sass.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_sass.rb b/test/test_sass.rb index 102815a0d..50d174ba1 100644 --- a/test/test_sass.rb +++ b/test/test_sass.rb @@ -16,11 +16,11 @@ class TestSass < Test::Unit::TestCase end should "register the SCSS converter" do - assert !!@site.getConverterImpl(Jekyll::Converters::Scss), "SCSS converter implementation should exist." + assert !!@site.find_converter_instance(Jekyll::Converters::Scss), "SCSS converter implementation should exist." end should "register the Sass converter" do - assert !!@site.getConverterImpl(Jekyll::Converters::Sass), "Sass converter implementation should exist." + assert !!@site.find_converter_instance(Jekyll::Converters::Sass), "Sass converter implementation should exist." end end end From ac41312c5d928d041be818f83802cd7450ba8642 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 14:37:02 -0500 Subject: [PATCH 085/407] Separate jekyll-docs out into a separate gem & bless it --- bin/jekyll | 9 ++---- lib/jekyll/commands/docs.rb | 30 ------------------- lib/jekyll/external.rb | 59 +++++++++++++++++++++++++++++++++++++ site/_docs/usage.md | 5 +++- 4 files changed, 66 insertions(+), 37 deletions(-) delete mode 100644 lib/jekyll/commands/docs.rb create mode 100644 lib/jekyll/external.rb diff --git a/bin/jekyll b/bin/jekyll index 060c91251..3f2988bc9 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -6,12 +6,9 @@ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib }) require 'jekyll' require 'mercenary' -%w[jekyll-import].each do |blessed_gem| - begin - require blessed_gem - rescue LoadError - end -end +Jekyll::External.require_if_present( + Jekyll::External.blessed_gems +) Jekyll::PluginManager.require_from_bundler diff --git a/lib/jekyll/commands/docs.rb b/lib/jekyll/commands/docs.rb deleted file mode 100644 index 71c101601..000000000 --- a/lib/jekyll/commands/docs.rb +++ /dev/null @@ -1,30 +0,0 @@ -module Jekyll - module Commands - class Docs < Command - - class << self - - def init_with_program(prog) - prog.command(:docs) do |c| - c.syntax 'docs' - c.description "Launch local server with docs for Jekyll v#{Jekyll::VERSION}" - - c.option 'port', '-P', '--port [PORT]', 'Port to listen on' - c.option 'host', '-H', '--host [HOST]', 'Host to bind to' - - c.action do |args, options| - options.merge!({ - 'source' => File.expand_path("../../../site", File.dirname(__FILE__)), - 'destination' => File.expand_path("../../../site/_site", File.dirname(__FILE__)) - }) - Jekyll::Commands::Build.process(options) - Jekyll::Commands::Serve.process(options) - end - end - end - - end - - end - end -end diff --git a/lib/jekyll/external.rb b/lib/jekyll/external.rb new file mode 100644 index 000000000..e41bce27d --- /dev/null +++ b/lib/jekyll/external.rb @@ -0,0 +1,59 @@ +module Jekyll + module External + class << self + + # + # Gems that, if installed, should be loaded. + # Usually contain subcommands. + # + def blessed_gems + %w{ + jekyll-docs + jekyll-import + } + end + + # + # Require a gem or file if it's present, otherwise silently fail. + # + # names - a string gem name or array of gem names + # + def require_if_present(names) + Array(names).each do |name| + begin + require name + rescue LoadError + Jekyll.logger.debug "Couldn't load #{name}. Skipping." + false + end + end + end + + # + # Require a gem or gems. If it's not present, show a very nice error + # message that explains everything and is much more helpful than the + # normal LoadError. + # + # names - a string gem name or array of gem names + # + def require_with_graceful_fail(names) + Array(names).each do |name| + begin + require name + rescue LoadError => e + Jekyll.logger.error "Dependency Error:", <<-MSG +Yikes! It looks like you don't have #{name} or one of its dependencies installed. +In order to use Jekyll as currently configured, you'll need to install this gem. + +The full error message from Ruby is: '#{e.message}' + +If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! + MSG + raise Jekyll::Errors::MissingDependencyException.new(name) + end + end + end + + end + end +end diff --git a/site/_docs/usage.md b/site/_docs/usage.md index 4959ad457..7d2d68e9f 100644 --- a/site/_docs/usage.md +++ b/site/_docs/usage.md @@ -81,4 +81,7 @@ $ jekyll build --source _source --destination _deploy {% endhighlight %} For more about the possible configuration options, see the -[configuration](../configuration/) page. \ No newline at end of file +[configuration](../configuration/) page. + +If you're interested in browsing these docs on-the-go, install the +`jekyll-docs` gem and run `jekyll docs` in your terminal. From 8c19a6f43082deb1dabbf636e178f841c0ce1940 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 14:37:14 -0500 Subject: [PATCH 086/407] Print an error message in bin/jekyll with no arguments --- bin/jekyll | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/jekyll b/bin/jekyll index 3f2988bc9..6c968cecb 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -29,6 +29,7 @@ Mercenary.program(:jekyll) do |p| p.action do |args, options| if args.empty? + Jekyll.logger.error "A subcommand is required." puts p else unless p.has_command?(args.first) From c576d239089ed301d0c003b8afd394271cca912c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 14:37:49 -0500 Subject: [PATCH 087/407] Use External instead of Deprecator for requiring gracefully --- lib/jekyll.rb | 12 +++++------- lib/jekyll/commands/build.rb | 2 +- .../converters/markdown/rdiscount_parser.rb | 2 +- .../converters/markdown/redcarpet_parser.rb | 6 +++--- lib/jekyll/deprecator.rb | 17 ----------------- 5 files changed, 10 insertions(+), 29 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index bde115815..3f01e4d0f 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -29,12 +29,6 @@ require 'liquid' require 'kramdown' require 'colorator' -# Conditional optimizations -begin - require 'liquid-c' -rescue LoadError -end - SafeYAML::OPTIONS[:suppress_warnings] = true Liquid::Template.error_mode = :strict @@ -51,6 +45,7 @@ module Jekyll autoload :EntryFilter, 'jekyll/entry_filter' autoload :Errors, 'jekyll/errors' autoload :Excerpt, 'jekyll/excerpt' + autoload :External, 'jekyll/external' autoload :Filters, 'jekyll/filters' autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults' autoload :Layout, 'jekyll/layout' @@ -162,6 +157,9 @@ module Jekyll end end + # Conditional optimizations + Jekyll::External.require_if_present('liquid-c') + end end @@ -172,7 +170,7 @@ require_all 'jekyll/generators' require_all 'jekyll/tags' # Eventually remove these for 3.0 as non-core -Jekyll::Deprecator.gracefully_require(%w[ +Jekyll::External.require_with_graceful_fail(%w[ toml jekyll-paginate jekyll-gist diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index 11f1f75e4..536324fce 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -66,7 +66,7 @@ module Jekyll # # Returns nothing. def watch(site, options) - Deprecator.gracefully_require 'jekyll-watch' + External.require_with_graceful_fail 'jekyll-watch' Jekyll::Watcher.watch(options) end diff --git a/lib/jekyll/converters/markdown/rdiscount_parser.rb b/lib/jekyll/converters/markdown/rdiscount_parser.rb index 0c8634e4b..fb5172e7a 100644 --- a/lib/jekyll/converters/markdown/rdiscount_parser.rb +++ b/lib/jekyll/converters/markdown/rdiscount_parser.rb @@ -3,7 +3,7 @@ module Jekyll class Markdown class RDiscountParser def initialize(config) - Jekyll::Deprecator.gracefully_require "rdiscount" + Jekyll::External.require_with_graceful_fail "rdiscount" @config = config @rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym } end diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index 468069e94..3be60739d 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -14,7 +14,7 @@ module Jekyll module WithPygments include CommonMethods def block_code(code, lang) - Jekyll::Deprecator.gracefully_require("pygments") + Jekyll::External.require_with_graceful_fail("pygments") lang = lang && lang.split.first || "text" add_code_tags( Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }), @@ -55,7 +55,7 @@ module Jekyll def initialize(config) - Deprecator.gracefully_require("redcarpet") + External.require_with_graceful_fail("redcarpet") @config = config @redcarpet_extensions = {} @config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true } @@ -71,7 +71,7 @@ module Jekyll end when "rouge" Class.new(Redcarpet::Render::HTML) do - Jekyll::Deprecator.gracefully_require(%w[ + Jekyll::External.require_with_graceful_fail(%w[ rouge rouge/plugins/redcarpet ]) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index 8e4daf9cc..9ec5857e1 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -40,22 +40,5 @@ module Jekyll Jekyll.logger.warn "Defaults:", "Please update your front-matter defaults to use 'type: #{current}'." end - def gracefully_require(gem_name) - Array(gem_name).each do |name| - begin - require name - rescue LoadError => e - Jekyll.logger.error "Dependency Error:", <<-MSG - Yikes! It looks like you don't have #{name} or one of its dependencies installed. - In order to use Jekyll as currently configured, you'll need to install this gem. - - The full error message from Ruby is: '#{e.message}' - - If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! -MSG - raise Errors::MissingDependencyException.new(name) - end - end - end end end From 1fad3a074f2f64bf30dfabe369b63934e47a8d74 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 23:35:54 -0500 Subject: [PATCH 088/407] Update history to reflect merge of #3241 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index eb3780764..de11e647b 100644 --- a/History.markdown +++ b/History.markdown @@ -9,6 +9,7 @@ ### Minor Enhancements * Sort static files just once, and call `site_payload` once for all collections (#3204) + * Separate `jekyll docs` and optimize external gem handling (#3241) ### Bug Fixes From eac3ac095fd32b21c5bf626974e80536b27f9650 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 23:36:37 -0500 Subject: [PATCH 089/407] Update history to reflect merge of #3240 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index de11e647b..0c2e9d9c3 100644 --- a/History.markdown +++ b/History.markdown @@ -10,6 +10,7 @@ * Sort static files just once, and call `site_payload` once for all collections (#3204) * Separate `jekyll docs` and optimize external gem handling (#3241) + * Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240) ### Bug Fixes From 928be16fabf7aad9ddc40333a9529d2b9102fdfc Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 14:28:03 -0500 Subject: [PATCH 090/407] Add Ruby 2.2 to Travis build matrix. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 72f0752d7..d8ba31005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: ruby cache: bundler sudo: false rvm: +- 2.2 - 2.1 - 2.0 env: From be23e18555b1deb97cbdeea72778810966c01286 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 28 Dec 2014 23:54:03 -0500 Subject: [PATCH 091/407] Say 'since 2.0' --- lib/jekyll/site.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 83ab283c5..58755f9ec 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -457,7 +457,7 @@ module Jekyll def relative_permalinks_deprecation_method if config['relative_permalinks'] && has_relative_page? - Jekyll.logger.warn "Deprecation:", "Starting in 2.0, permalinks for pages" + + Jekyll.logger.warn "Deprecation:", "Since v2.0, permalinks for pages" + " in subfolders must be relative to the" + " site source directory, not the parent" + " directory. Check http://jekyllrb.com/docs/upgrading/"+ From 5af7694f3b502e963fcc065c2712271b3d935f5c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:23:57 -0500 Subject: [PATCH 092/407] Update history to reflect merge of #2790 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 0c2e9d9c3..33bb468d5 100644 --- a/History.markdown +++ b/History.markdown @@ -22,6 +22,7 @@ ### Site Enhancements * Fixing the default host on docs (#3229) + * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) ## 2.5.3 / 2014-12-22 From 191c2279d24ba8137baa18f29314a8863482343a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:26:58 -0500 Subject: [PATCH 093/407] Update history to reflect merge of #2908 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 33bb468d5..a4a676f76 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ * Sort static files just once, and call `site_payload` once for all collections (#3204) * Separate `jekyll docs` and optimize external gem handling (#3241) * Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240) + * Use relative path for `path` Liquid variable in Documents for consistency (#2908) ### Bug Fixes From 004f923644f16dba949143e92d0c74149d6140f5 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 18 Oct 2014 13:17:12 -0700 Subject: [PATCH 094/407] Revert "Revert "Make permalink parsing consistent with pages"" --- features/permalinks.feature | 4 ++-- lib/jekyll/post.rb | 2 +- test/test_post.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/permalinks.feature b/features/permalinks.feature index 67dfbb471..c4494b4eb 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -39,7 +39,7 @@ Feature: Fancy permalinks And I have the following post: | title | category | date | content | | Custom Permalink Schema | stuff | 2009-03-27 | Totally custom. | - And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title" + And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title/" When I run jekyll build Then the _site directory should exist And I should see "Totally custom." in "_site/blog/2009/03/27/custom-permalink-schema/index.html" @@ -68,7 +68,7 @@ Feature: Fancy permalinks Given I have a _posts directory And I have the following post: | title | date | permalink | content | - | Some post | 2013-04-14 | /custom/posts/1 | bla bla | + | Some post | 2013-04-14 | /custom/posts/1/ | bla bla | When I run jekyll build Then the _site directory should exist And the _site/custom/posts/1 directory should exist diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index c377e376e..7d11b0bff 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -269,7 +269,7 @@ module Jekyll def destination(dest) # The url needs to be unescaped in order to preserve the correct filename path = site.in_dest_dir(dest, URL.unescape_path(url)) - path = File.join(path, "index.html") if path[/\.html?$/].nil? + path = File.join(path, "index.html") if self.url =~ /\/$/ path end diff --git a/test/test_post.rb b/test/test_post.rb index 2592b9185..e6ecdaf3c 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -592,7 +592,7 @@ class TestPost < Test::Unit::TestCase should "write properly without html extension" do post = setup_post("2008-10-18-foo-bar.textile") - post.site.permalink_style = ":title" + post.site.permalink_style = ":title/" do_render(post) post.write(dest_dir) From 6f7ea381b303892a2beca0078121cb9d8fc7f55f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:31:53 -0500 Subject: [PATCH 095/407] Update history to reflect merge of #3047 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index a4a676f76..5ffd37950 100644 --- a/History.markdown +++ b/History.markdown @@ -12,6 +12,7 @@ * Separate `jekyll docs` and optimize external gem handling (#3241) * Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240) * Use relative path for `path` Liquid variable in Documents for consistency (#2908) + * Generalize Utils#slugify for any scripts (#3047) ### Bug Fixes From bab7ef4b1debc7611b9433beb46f1f0e25fd851d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:32:14 -0500 Subject: [PATCH 096/407] Use backticks here. [ci skip]. --- History.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.markdown b/History.markdown index 5ffd37950..e06343817 100644 --- a/History.markdown +++ b/History.markdown @@ -12,7 +12,7 @@ * Separate `jekyll docs` and optimize external gem handling (#3241) * Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240) * Use relative path for `path` Liquid variable in Documents for consistency (#2908) - * Generalize Utils#slugify for any scripts (#3047) + * Generalize `Utils#slugify` for any scripts (#3047) ### Bug Fixes From a6781bda303dca2b6b48dc20ee12c50d89cddef8 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:37:16 -0500 Subject: [PATCH 097/407] Always, always rebuild (by default) in tests. --- test/helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index 48bfc746b..132b1f620 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -35,7 +35,8 @@ class Test::Unit::TestCase def site_configuration(overrides = {}) full_overrides = build_configs(overrides, build_configs({"destination" => dest_dir})) build_configs({ - "source" => source_dir, + "source" => source_dir, + "full_rebuild" => true }, full_overrides) end From d7d7d924f7999a9e34b6846bbdb030bb55285dc5 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:50:12 -0500 Subject: [PATCH 098/407] Update history to reflect merge of #3189 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e06343817..f2d400349 100644 --- a/History.markdown +++ b/History.markdown @@ -13,6 +13,7 @@ * Improve `Site#getConverterImpl` and call it `Site#find_converter_instance` (#3240) * Use relative path for `path` Liquid variable in Documents for consistency (#2908) * Generalize `Utils#slugify` for any scripts (#3047) + * Added basic microdata to post template in site template (#3189) ### Bug Fixes From 5f03314d85a4d8bd45e691721e675546078d50ef Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:50:57 -0500 Subject: [PATCH 099/407] Update history to reflect merge of #3186 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index f2d400349..574d3c091 100644 --- a/History.markdown +++ b/History.markdown @@ -26,6 +26,7 @@ * Fixing the default host on docs (#3229) * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) + * Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186) ## 2.5.3 / 2014-12-22 From e0a011c917f8bc1a7751a23f2cbbca2788cd7c67 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 00:52:47 -0500 Subject: [PATCH 100/407] Update history to reflect merge of #3185 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 574d3c091..cced5730d 100644 --- a/History.markdown +++ b/History.markdown @@ -27,6 +27,7 @@ * Fixing the default host on docs (#3229) * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) * Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186) + * Add a Resources link to tutorial on building dynamic navbars (#3185) ## 2.5.3 / 2014-12-22 From b2146e865992a143b1305c9e0a87025f061c1051 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 22 Jul 2014 14:08:11 -0400 Subject: [PATCH 101/407] Store log messages in an array of messages. --- lib/jekyll/log_adapter.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/log_adapter.rb b/lib/jekyll/log_adapter.rb index 63e23fcd2..88a90d26e 100644 --- a/lib/jekyll/log_adapter.rb +++ b/lib/jekyll/log_adapter.rb @@ -87,7 +87,9 @@ module Jekyll # # Returns the formatted message def message(topic, message) - formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ') + msg = formatted_topic(topic) + message.to_s.gsub(/\s+/, ' ') + messages << msg + msg end # Internal: Format the topic @@ -98,5 +100,12 @@ module Jekyll def formatted_topic(topic) "#{topic} ".rjust(20) end + + # Public: All the messages Stevenson has printed so far + # + # Returns an Array of all messages Stevenson has built so far using #message + def messages + @messages ||= Array.new + end end end From 7fc47bfc4367da1612c02760e67d2e61c42708a3 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 01:08:42 -0500 Subject: [PATCH 102/407] Initialize @messages at instantiation time. --- lib/jekyll/log_adapter.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/jekyll/log_adapter.rb b/lib/jekyll/log_adapter.rb index 88a90d26e..46e0fe1fb 100644 --- a/lib/jekyll/log_adapter.rb +++ b/lib/jekyll/log_adapter.rb @@ -1,6 +1,6 @@ module Jekyll class LogAdapter - attr_reader :writer + attr_reader :writer, :messages LOG_LEVELS = { :debug => ::Logger::DEBUG, @@ -16,6 +16,7 @@ module Jekyll # # Returns nothing def initialize(writer, level = :info) + @messages = [] @writer = writer self.log_level = level end @@ -100,12 +101,5 @@ module Jekyll def formatted_topic(topic) "#{topic} ".rjust(20) end - - # Public: All the messages Stevenson has printed so far - # - # Returns an Array of all messages Stevenson has built so far using #message - def messages - @messages ||= Array.new - end end end From 1fc99bdd9772d9c52ffc4d2aebdd04a998333f6b Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 01:14:13 -0500 Subject: [PATCH 103/407] Test LogAdapter#messages --- test/test_log_adapter.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test_log_adapter.rb b/test/test_log_adapter.rb index 3dd3465ea..712725694 100644 --- a/test/test_log_adapter.rb +++ b/test/test_log_adapter.rb @@ -3,6 +3,11 @@ require 'helper' class TestLogAdapter < Test::Unit::TestCase class LoggerDouble attr_accessor :level + + def debug(*); end + def info(*); end + def warn(*); end + def error(*); end end context "#log_level=" do @@ -56,4 +61,20 @@ class TestLogAdapter < Test::Unit::TestCase assert_raise(SystemExit) { logger.abort_with('topic', 'log message') } end end + + context "#messages" do + should "return an array" do + assert_equal [], Jekyll::LogAdapter.new(LoggerDouble.new).messages + end + + should "store each log value in the array" do + logger = Jekyll::LogAdapter.new(LoggerDouble.new) + values = %w{one two three four} + logger.debug(values[0]) + logger.info(values[1]) + logger.warn(values[2]) + logger.error(values[3]) + assert_equal values.map { |value| "#{value} ".rjust(20) }, logger.messages + end + end end From 7f034f51e3d2d508a3a7942928b9eb19bad83bd7 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 02:16:04 -0500 Subject: [PATCH 104/407] Improvments to script/stackprof. [ci skip] --- script/stackprof | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/stackprof b/script/stackprof index e0e2d4dbc..3399616f2 100755 --- a/script/stackprof +++ b/script/stackprof @@ -6,11 +6,11 @@ export BENCHMARK=true command -v stackprof > /dev/null || script/bootstrap TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})" -PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d).dump +PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d%H%M).dump test -f "$PROF_OUTPUT_FILE" || { bundle exec ruby -r./lib/jekyll -rstackprof \ - -e "StackProf.run(mode: :cpu, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }" + -e "StackProf.run(mode: :cpu, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }" } bundle exec stackprof $PROF_OUTPUT_FILE $@ From 5e10958faab58d6f380f4b17aa0032aa5a6284ed Mon Sep 17 00:00:00 2001 From: nitoyon Date: Mon, 15 Sep 2014 02:20:09 +0900 Subject: [PATCH 105/407] Unescape Document output path Document#destination wasn't unescaped properly. For example, when we have a document named '_langs/c#.md', we expect its url to be '/langs/c#.html', but it was actually '/langs/c%23.html'. We now unecape URL at Document#destination like Post#destination and Page#destination. --- features/collections.feature | 12 +++++----- lib/jekyll/document.rb | 2 +- test/source/_methods/escape-+ #%20[].md | 5 +++++ test/test_collections.rb | 1 + test/test_document.rb | 30 +++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 test/source/_methods/escape-+ #%20[].md diff --git a/features/collections.feature b/features/collections.feature index 4f69e8b95..1cdbff4b8 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -9,7 +9,7 @@ Feature: Collections And I have a configuration file with "collections" set to "['methods']" When I run jekyll build Then the _site directory should exist - And I should see "Collections:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

\n

Jekyll.sanitized_path is used to make sure your path is in your source.

\n

Run your generators! default

\n

Page without title.

\n

Run your generators! default

" in "_site/index.html" + And I should see "Collections:

Use Jekyll.configuration to build a full configuration for use w/Jekyll.

\n\n

Whatever: foo.bar

\n

Signs are nice

\n

Jekyll.sanitized_path is used to make sure your path is in your source.

\n

Run your generators! default

\n

Page without title.

\n

Run your generators! default

" in "_site/index.html" And the "_site/methods/configuration.html" file should not exist Scenario: Rendered collection @@ -70,7 +70,7 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" + And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" Scenario: Collections specified as an hash Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}" @@ -82,7 +82,7 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" + And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" Scenario: All the documents Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}" @@ -94,7 +94,7 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "All documents: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" + And I should see "All documents: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" Scenario: Documents have an output attribute, which is the converted HTML Given I have an "index.html" page that contains "First document's output: {{ site.documents.first.output }}" @@ -130,7 +130,7 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "1. of 5:

Page without title.

" in "_site/index.html" + And I should see "1. of 6:

Page without title.

" in "_site/index.html" Scenario: Sort by relative_path Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{% for method in methods %}{{ method.title }}, {% endfor %}" @@ -142,4 +142,4 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "Collections: Jekyll.configuration, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html" + And I should see "Collections: Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html" diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 31317a46a..f01c15e21 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -167,7 +167,7 @@ module Jekyll # Returns the full path to the output file of this document. def destination(base_directory) dest = site.in_dest_dir(base_directory) - path = site.in_dest_dir(dest, url) + path = site.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if url =~ /\/$/ path end diff --git a/test/source/_methods/escape-+ #%20[].md b/test/source/_methods/escape-+ #%20[].md new file mode 100644 index 000000000..528317a74 --- /dev/null +++ b/test/source/_methods/escape-+ #%20[].md @@ -0,0 +1,5 @@ +--- +title: "Jekyll.escape" +--- + +Signs are nice diff --git a/test/test_collections.rb b/test/test_collections.rb index 1975e402c..e9f324eea 100644 --- a/test/test_collections.rb +++ b/test/test_collections.rb @@ -138,6 +138,7 @@ class TestCollections < Test::Unit::TestCase _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md + _methods/escape-+\ #%20[].md ], doc.relative_path end end diff --git a/test/test_document.rb b/test/test_document.rb index a4543148c..7ba17b04f 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -275,4 +275,34 @@ class TestDocument < Test::Unit::TestCase end end + context "a document in a collection with non-alphabetic file name" do + setup do + @site = Site.new(Jekyll.configuration({ + "collections" => { + "methods" => { + "output" => true + } + }, + "source" => source_dir, + "destination" => dest_dir + })) + @site.process + @document = @site.collections["methods"].docs.find { |doc| doc.relative_path == "_methods/escape-+ #%20[].md" } + @dest_file = dest_dir("methods/escape-+ #%20[].html") + end + + should "produce the right URL" do + assert_equal "/methods/escape-+%20%23%2520%5B%5D.html", @document.url + end + + should "produce the right destination" do + assert_equal @dest_file, @document.destination(dest_dir) + end + + should "be output in the correct place" do + assert_equal true, File.file?(@dest_file) + end + + end + end From cb95a72f5a70fc0eda5d38320f1dac74aa4227f5 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 18:00:54 -0500 Subject: [PATCH 106/407] Update history to reflect merge of #2924 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index cced5730d..1a948269e 100644 --- a/History.markdown +++ b/History.markdown @@ -19,6 +19,7 @@ * Remove unneeded end tag for `link` in site template (#3236) * Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237) + * Unescape `Document` output path (#2924) ### Development Fixes From f66862c508d5405006639c3dd63b4322b9483e30 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 25 Dec 2014 14:35:45 -0500 Subject: [PATCH 107/407] Install rake if the lib isn't there; upgrade to cucumber 1.3.18 --- Gemfile | 4 ++-- features/markdown.feature | 2 +- features/site_configuration.feature | 2 +- features/step_definitions/jekyll_steps.rb | 1 + script/bootstrap | 2 +- script/cucumber | 3 +++ script/test | 10 +++++++++- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index c79afe7ce..2bc6abc32 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'rdoc', '~> 3.11' gem 'redgreen', '~> 1.2' gem 'shoulda', '~> 3.5' gem 'rr', '~> 1.1' -gem 'cucumber', '1.3.11' +gem 'cucumber', '1.3.18' gem 'RedCloth', '~> 4.2' gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 1.6' @@ -20,7 +20,7 @@ gem 'jekyll_test_plugin_malicious' gem 'rouge', '~> 1.7' gem 'liquid-c', '~> 0.0.3' gem 'minitest' if RUBY_PLATFORM =~ /cygwin/ -gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ +gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/features/markdown.feature b/features/markdown.feature index 659eed0fa..895c927ad 100644 --- a/features/markdown.feature +++ b/features/markdown.feature @@ -47,7 +47,7 @@ Feature: Markdown And I should see "My awesome code" in "_site/index.html" And I should see "
My awesome code
" in "_site/index.html" - Scenario: Maruku fenced codeblocks + Scenario: Maruku fenced codeblocks with syntax highlighting Given I have a configuration file with "markdown" set to "maruku" And I have an "index.markdown" file with content: """ diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 1d067f0c9..13dd7aa12 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -180,7 +180,7 @@ Feature: Site configuration And I have an "index.html" page with layout "page" that contains "site index page" And I have a configuration file with: | key | value | - | timezone | Australia/Melbourne | + | timezone | Australia/Sydney | And I have a _posts directory And I have the following posts: | title | date | layout | content | diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 069f93b0f..3b77d03b0 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -24,6 +24,7 @@ end After do FileUtils.rm_rf(TEST_DIR) if File.exist?(TEST_DIR) FileUtils.rm(JEKYLL_COMMAND_OUTPUT_FILE) if File.exist?(JEKYLL_COMMAND_OUTPUT_FILE) + Dir.chdir(File.dirname(TEST_DIR)) end World(Test::Unit::Assertions) diff --git a/script/bootstrap b/script/bootstrap index 097f3e27f..997560464 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -1,4 +1,4 @@ #!/bin/sh script/branding -bundle install +bundle install -j8 diff --git a/script/cucumber b/script/cucumber index c69573560..aeb9032d3 100755 --- a/script/cucumber +++ b/script/cucumber @@ -1,5 +1,8 @@ #!/bin/bash +ls /usr/share/zoneinfo +ls /usr/share/zoneinfo/Australia + time bundle exec cucumber \ -f Features::Support::Overview \ "$@" diff --git a/script/test b/script/test index 7bb742ef9..52dc4b927 100755 --- a/script/test +++ b/script/test @@ -10,7 +10,15 @@ else TEST_FILES="$@" fi -RAKE_LIB_DIR=$(ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir + '/lib'") +# bundle exec gem env +GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2) +RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'") +RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}" + +test -d "${RAKE_LIB_DIR}" || { + echo "No ${RAKE_LIB_DIR}. Installing Rake." + bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v +} set -x From 7bcf8d689ef28b2d07e7196371ec1854f50c8f2a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 19:15:19 -0500 Subject: [PATCH 108/407] Always call Time#localtime to translate to TZ'd time. --- features/site_configuration.feature | 2 +- features/step_definitions/jekyll_steps.rb | 10 +++++++++- features/support/env.rb | 11 +++++++++++ lib/jekyll/filters.rb | 2 +- lib/jekyll/utils.rb | 2 +- script/cucumber | 3 --- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 13dd7aa12..1d067f0c9 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -180,7 +180,7 @@ Feature: Site configuration And I have an "index.html" page with layout "page" that contains "site index page" And I have a configuration file with: | key | value | - | timezone | Australia/Sydney | + | timezone | Australia/Melbourne | And I have a _posts directory And I have the following posts: | title | date | layout | content | diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 3b77d03b0..98f14ad15 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -193,7 +193,15 @@ Then /^I should see escaped "(.*)" in "(.*)"$/ do |text, file| end Then /^the "(.*)" file should +exist$/ do |file| - assert File.file?(file), "The file \"#{file}\" does not exist" + file_does_exist = File.file?(file) + unless file_does_exist + all_steps_to_path(file).each do |dir| + STDERR.puts "" + STDERR.puts "Dir #{dir}:" + STDERR.puts Dir["#{dir}/**/*"] + end + end + assert file_does_exist, "The file \"#{file}\" does not exist.\n" end Then /^the "(.*)" file should not exist$/ do |file| diff --git a/features/support/env.rb b/features/support/env.rb index ba4555fec..e995ba9b3 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -13,6 +13,17 @@ def source_dir(*files) File.join(TEST_DIR, *files) end +def all_steps_to_path(path) + source = Pathname.new(source_dir('_site')).expand_path + dest = Pathname.new(path).expand_path + paths = [] + dest.ascend do |f| + break if f.eql? source + paths.unshift f.to_s + end + paths +end + def jekyll_output_file JEKYLL_COMMAND_OUTPUT_FILE end diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 17a4142b4..fca03437c 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -309,7 +309,7 @@ module Jekyll else Jekyll.logger.error "Invalid Date:", "'#{input}' is not a valid datetime." exit(1) - end + end.localtime end def groupable?(element) diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index 34861593a..0291c2e99 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -90,7 +90,7 @@ module Jekyll # Returns the parsed date if successful, throws a FatalException # if not def parse_date(input, msg = "Input could not be parsed.") - Time.parse(input) + Time.parse(input).localtime rescue ArgumentError raise Errors::FatalException.new("Invalid date '#{input}': " + msg) end diff --git a/script/cucumber b/script/cucumber index aeb9032d3..c69573560 100755 --- a/script/cucumber +++ b/script/cucumber @@ -1,8 +1,5 @@ #!/bin/bash -ls /usr/share/zoneinfo -ls /usr/share/zoneinfo/Australia - time bundle exec cucumber \ -f Features::Support::Overview \ "$@" From 9109da32f9c329219bf84cfc0f2192a2c5075e21 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 20:44:10 -0500 Subject: [PATCH 109/407] Update test for the date() Liquid filter. --- test/test_filters.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_filters.rb b/test/test_filters.rb index a9fc951db..659b7a849 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -72,11 +72,11 @@ class TestFilters < Test::Unit::TestCase end should "format a time with xmlschema" do - assert_equal "2013-03-27T11:22:33Z", @filter.date_to_xmlschema(@sample_time) + assert_equal "2013-03-27T11:22:33+00:00", @filter.date_to_xmlschema(@sample_time) end should "format a time according to RFC-822" do - assert_equal "Wed, 27 Mar 2013 11:22:33 -0000", @filter.date_to_rfc822(@sample_time) + assert_equal "Wed, 27 Mar 2013 11:22:33 +0000", @filter.date_to_rfc822(@sample_time) end end @@ -90,11 +90,11 @@ class TestFilters < Test::Unit::TestCase end should "format a time with xmlschema" do - assert_equal "2001-09-11T12:46:30Z", @filter.date_to_xmlschema(@time_as_string) + assert_equal "2001-09-11T12:46:30+00:00", @filter.date_to_xmlschema(@time_as_string) end should "format a time according to RFC-822" do - assert_equal "Tue, 11 Sep 2001 12:46:30 -0000", @filter.date_to_rfc822(@time_as_string) + assert_equal "Tue, 11 Sep 2001 12:46:30 +0000", @filter.date_to_rfc822(@time_as_string) end end From 419aaba07cb9237e9f7a28d34f9516bf1136fbc2 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 20:48:31 -0500 Subject: [PATCH 110/407] Update history to reflect merge of #3244 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1a948269e..e11ea568d 100644 --- a/History.markdown +++ b/History.markdown @@ -14,6 +14,7 @@ * Use relative path for `path` Liquid variable in Documents for consistency (#2908) * Generalize `Utils#slugify` for any scripts (#3047) * Added basic microdata to post template in site template (#3189) + * Store log messages in an array of messages. (#3244) ### Bug Fixes From e40e12fabd33fd6b9997e09ef7c022b61be05593 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 29 Dec 2014 20:49:25 -0500 Subject: [PATCH 111/407] Update history to reflect merge of #3234 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e11ea568d..1c73ded3d 100644 --- a/History.markdown +++ b/History.markdown @@ -5,6 +5,7 @@ * Incremental regeneration (#3116) * Drop support for Ruby 1.9.3. (#3235) * Upgrade to Liquid 3.0.0 (#3002) + * Support Ruby v2.2 (#3234) ### Minor Enhancements From 07bd3a3759d8f5b6a4854239cff347b5b23c581f Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Thu, 1 Jan 2015 23:58:27 -0600 Subject: [PATCH 112/407] Clarify paragraph on the return value of `generate` --- site/_docs/plugins.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 605cbf684..b5cf9543c 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -66,11 +66,8 @@ based on your own rules. A generator is a subclass of `Jekyll::Generator` that defines a `generate` method, which receives an instance of -[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). - -The return value of `generate` is ignored, since generation is triggered for -its side effects. Jekyll does not expect any particular side effect to -happen---it just runs the method. +[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). The +return value of `generate` is ignored. Generators run after Jekyll has made an inventory of the existing content, and before the site is generated. Pages with YAML Front Matters are stored as From 21bd3e6c5a996e207af7dd9fc8fb9e7a44a4c603 Mon Sep 17 00:00:00 2001 From: Seth Warburton Date: Fri, 2 Jan 2015 12:14:58 +0000 Subject: [PATCH 113/407] [imp] Semantic structure improvements --- lib/site_template/_layouts/page.html | 8 ++++---- lib/site_template/_layouts/post.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/site_template/_layouts/page.html b/lib/site_template/_layouts/page.html index 74c1a1184..ce233ad75 100644 --- a/lib/site_template/_layouts/page.html +++ b/lib/site_template/_layouts/page.html @@ -1,14 +1,14 @@ --- layout: default --- -
+

{{ page.title }}

-
+
{{ content }} -
+
-
+
diff --git a/lib/site_template/_layouts/post.html b/lib/site_template/_layouts/post.html index 5a072b3ef..d34c02d20 100644 --- a/lib/site_template/_layouts/post.html +++ b/lib/site_template/_layouts/post.html @@ -1,15 +1,15 @@ --- layout: default --- -
+

{{ page.title }}

-
+
{{ content }} -
+
-
+
From 86f7196ef51d31eb886910c8ecd3d9c232f119c7 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Fri, 2 Jan 2015 13:27:07 -0600 Subject: [PATCH 114/407] Update history to reflect merge of #3251 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1c73ded3d..c44857d71 100644 --- a/History.markdown +++ b/History.markdown @@ -31,6 +31,7 @@ * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) * Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186) * Add a Resources link to tutorial on building dynamic navbars (#3185) + * Semantic structure improvements to the post and page layouts (#3251) ## 2.5.3 / 2014-12-22 From d29dd11ae33e1c6c999147b9862fb9d0eddeffa4 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Fri, 2 Jan 2015 13:38:59 -0600 Subject: [PATCH 115/407] Update history to reflect merge of #3233 [ci skip] --- History.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.markdown b/History.markdown index c44857d71..d7c5ef6e3 100644 --- a/History.markdown +++ b/History.markdown @@ -25,6 +25,8 @@ ### Development Fixes + * Improve the grammar in the documentation (#3233) + ### Site Enhancements * Fixing the default host on docs (#3229) From d159684f87c97e4c5edbec4a0df21ed4480dfbce Mon Sep 17 00:00:00 2001 From: Suriyaa Kudo Date: Sat, 3 Jan 2015 11:59:24 +0100 Subject: [PATCH 116/407] Update LICENSE --- LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 0e5f84407..ce4e011dd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,9 @@ -(The MIT License) +The MIT License (MIT) Copyright (c) 2008-2014 Tom Preston-Werner Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the 'Software'), to deal +of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is @@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER From 51951c43e823294ebc848eaaa8840d65b919e2fb Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 3 Jan 2015 09:49:52 -0600 Subject: [PATCH 117/407] Update history to reflect merge of #3253 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index d7c5ef6e3..971455389 100644 --- a/History.markdown +++ b/History.markdown @@ -26,6 +26,7 @@ ### Development Fixes * Improve the grammar in the documentation (#3233) + * Update the LICENSE text to match the MIT license exactly (#3253) ### Site Enhancements From 7f370cb82f6cd642230fc1ca7954485934d011f7 Mon Sep 17 00:00:00 2001 From: Alan Scherger Date: Sat, 3 Jan 2015 19:43:55 -0800 Subject: [PATCH 118/407] Update rake task site:publish to fix minor bugs. * Automate creating gh-pages directory * Ensure gh-pages dir always has correct branch checked out * Purge gh-pages of files so that a sync of site truly occurs * Ensure dot files are synced * Be exact with our exclusions to eliminate guess work --- Rakefile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index 991f63e08..1f5668604 100644 --- a/Rakefile +++ b/Rakefile @@ -179,22 +179,32 @@ namespace :site do # Ensure the gh-pages dir exists so we can generate into it. puts "Checking for gh-pages dir..." unless File.exist?("./gh-pages") - puts "No gh-pages directory found. Run the following commands first:" - puts " `git clone git@github.com:jekyll/jekyll gh-pages" - puts " `cd gh-pages" - puts " `git checkout gh-pages`" - exit(1) + puts "Creating gh-pages dir..." + sh "git clone git@github.com:jekyll/jekyll gh-pages" end - # Ensure gh-pages branch is up to date. + # Ensure latest gh-pages branch history. Dir.chdir('gh-pages') do + sh "git checkout gh-pages" sh "git pull origin gh-pages" end - # Copy to gh-pages dir. + # Proceed to purge all files in case we removed a file in this release. + puts "Cleaning gh-pages directory..." + Dir.glob("gh-pages/{*,.*}") do |path| + next if path.eql? "gh-pages/." + next if path.eql? "gh-pages/.." + next if path.eql? "gh-pages/.git" + sh "rm -rf #{path}" + end + + # Copy site to gh-pages dir. puts "Copying site to gh-pages branch..." - Dir.glob("site/*") do |path| - next if path.include? "_site" + Dir.glob("site/{*,.*}") do |path| + next if path.eql? "site/." + next if path.eql? "site/.." + next if path.eql? "site/.jekyll-metadata" + next if path.eql? "site/_site" sh "cp -R #{path} gh-pages/" end From 2f06f4aad70fb5c46f0eaa1c0d8041cab7d66e85 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 3 Jan 2015 23:06:17 -0800 Subject: [PATCH 119/407] Update history to reflect merge of #3254 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 971455389..6fb5e4695 100644 --- a/History.markdown +++ b/History.markdown @@ -27,6 +27,7 @@ * Improve the grammar in the documentation (#3233) * Update the LICENSE text to match the MIT license exactly (#3253) + * Update rake task `site:publish` to fix minor bugs. (#3254) ### Site Enhancements From b20a175c27716881e5ecb467559c1b29197ec65a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 4 Jan 2015 13:09:16 +0200 Subject: [PATCH 120/407] Switch to shields.io for the README badges. This way we have consistent badges. [ci skip] --- README.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index b68166cbd..95c49bd74 100644 --- a/README.markdown +++ b/README.markdown @@ -1,9 +1,9 @@ # [Jekyll](http://jekyllrb.com/) -[![Gem Version](https://badge.fury.io/rb/jekyll.svg)](https://rubygems.org/gems/jekyll) -[![Build Status](https://secure.travis-ci.org/jekyll/jekyll.svg?branch=master)](https://travis-ci.org/jekyll/jekyll) -[![Code Climate](http://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll) -[![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll) +[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)](https://rubygems.org/gems/jekyll) +[![Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg)](https://travis-ci.org/jekyll/jekyll) +[![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll) +[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll) [![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)](https://hakiri.io/github/jekyll/jekyll/master) By Tom Preston-Werner, Nick Quaranto, Parker Moore, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)! From fc0ea20a8550c927c6753c73f3eecb29197e6b1d Mon Sep 17 00:00:00 2001 From: Alan Scherger Date: Sun, 4 Jan 2015 20:46:43 -0800 Subject: [PATCH 121/407] Use FileList instead of Dir.glob --- Rakefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index 1f5668604..31434cd41 100644 --- a/Rakefile +++ b/Rakefile @@ -191,20 +191,24 @@ namespace :site do # Proceed to purge all files in case we removed a file in this release. puts "Cleaning gh-pages directory..." - Dir.glob("gh-pages/{*,.*}") do |path| - next if path.eql? "gh-pages/." - next if path.eql? "gh-pages/.." - next if path.eql? "gh-pages/.git" + purge_exclude = %w[ + gh-pages/. + gh-pages/.. + gh-pages/.git + ] + FileList["gh-pages/{*,.*}"].exclude(*purge_exclude).each do |path| sh "rm -rf #{path}" end # Copy site to gh-pages dir. puts "Copying site to gh-pages branch..." - Dir.glob("site/{*,.*}") do |path| - next if path.eql? "site/." - next if path.eql? "site/.." - next if path.eql? "site/.jekyll-metadata" - next if path.eql? "site/_site" + copy_exclude = %w[ + site/. + site/.. + site/.jekyll-metadata + site/_site + ] + FileList["site/{*,.*}"].exclude(*copy_exclude).each do |path| sh "cp -R #{path} gh-pages/" end From f7dafb1f04f7c39a6c5b3b81f68beb14b5dd23b3 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 5 Jan 2015 00:06:51 -0800 Subject: [PATCH 122/407] Update history to reflect merge of #3255 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 6fb5e4695..531349e99 100644 --- a/History.markdown +++ b/History.markdown @@ -28,6 +28,7 @@ * Improve the grammar in the documentation (#3233) * Update the LICENSE text to match the MIT license exactly (#3253) * Update rake task `site:publish` to fix minor bugs. (#3254) + * Switch to shields.io for the README badges. (#3255) ### Site Enhancements From 620115a98656e2b8c98a60402fd8fd143e4f59e8 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 5 Jan 2015 00:08:08 -0800 Subject: [PATCH 123/407] Update history to reflect merge of #3261 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 531349e99..acc38791c 100644 --- a/History.markdown +++ b/History.markdown @@ -29,6 +29,7 @@ * Update the LICENSE text to match the MIT license exactly (#3253) * Update rake task `site:publish` to fix minor bugs. (#3254) * Switch to shields.io for the README badges. (#3255) + * Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261) ### Site Enhancements From a2b6aa263ecff76247ca039f66430f3bd52dd791 Mon Sep 17 00:00:00 2001 From: Mads Ohm Larsen Date: Sun, 4 Jan 2015 18:25:19 +0100 Subject: [PATCH 124/407] Add local tmp folder --- .gitignore | 2 +- script/test | 4 ++++ test/source/_includes/tmp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d9effd5b7..36da96562 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,5 @@ site/_site/ coverage .ruby-version .sass-cache -tmp/stackprof-* +tmp/* .jekyll-metadata diff --git a/script/test b/script/test index 52dc4b927..eddb7f4b8 100755 --- a/script/test +++ b/script/test @@ -4,6 +4,10 @@ # script/test # script/test +if [ ! -d tmp ]; then + mkdir tmp +fi + if [ -z "$1" ]; then TEST_FILES="./test/test_*.rb" else diff --git a/test/source/_includes/tmp b/test/source/_includes/tmp index cad230910..a846f50df 120000 --- a/test/source/_includes/tmp +++ b/test/source/_includes/tmp @@ -1 +1 @@ -/tmp \ No newline at end of file +../../../tmp/ \ No newline at end of file From 1062fdf89fb913e8548b5208b499280103f5365d Mon Sep 17 00:00:00 2001 From: Mads Ohm Larsen Date: Sun, 4 Jan 2015 18:25:29 +0100 Subject: [PATCH 125/407] Use local tmp folder for symlink tests --- test/test_tags.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_tags.rb b/test/test_tags.rb index bc4b48cd7..bdfae6eaa 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -319,7 +319,7 @@ CONTENT context "with symlink'd include" do should "not allow symlink includes" do - File.open("/tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") } + File.open("tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") } assert_raise IOError do content = < Date: Tue, 25 Nov 2014 22:43:43 +0200 Subject: [PATCH 126/407] Docs: Assorted accessibility tweaks. --- site/_includes/anchor_links.html | 3 ++- site/_includes/footer.html | 2 +- site/_includes/header.html | 6 +++--- site/_includes/news_item.html | 2 +- site/_layouts/news_item.html | 2 +- site/_sass/_style.scss | 36 +++++++++++++++++++++----------- site/index.html | 2 +- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/site/_includes/anchor_links.html b/site/_includes/anchor_links.html index 08e37b5b2..c584ce5d7 100644 --- a/site/_includes/anchor_links.html +++ b/site/_includes/anchor_links.html @@ -3,7 +3,8 @@ var anchor = document.createElement("a"); anchor.className = "header-link"; anchor.href = "#" + id; - anchor.innerHTML = ""; + anchor.innerHTML = "Permalink"; + anchor.title = "Permalink"; return anchor; }; diff --git a/site/_includes/footer.html b/site/_includes/footer.html index c42b1a469..09bab7375 100644 --- a/site/_includes/footer.html +++ b/site/_includes/footer.html @@ -1,4 +1,4 @@ -
+
diff --git a/site/_layouts/news_item.html b/site/_layouts/news_item.html index 6d27976a1..57ba62228 100644 --- a/site/_layouts/news_item.html +++ b/site/_layouts/news_item.html @@ -17,7 +17,7 @@ layout: news {{ page.date | date_to_string }}
diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss index 38bf814ad..80b1d604e 100644 --- a/site/_sass/_style.scss +++ b/site/_sass/_style.scss @@ -44,9 +44,6 @@ header { h1, nav { display: inline-block; } - h1 { - span { display: none; } - } } nav { @@ -165,10 +162,10 @@ h6:hover .header-link { /* Footer */ footer { - background-color: #222; + background-color: #212121; font-size: 16px; padding-bottom: 5px; - color: #888; + color: #c0c0c0; margin-top: 40px; a { @@ -230,7 +227,7 @@ footer { .content { padding: 0; } - h4 { + h3 { font-size: 24px; line-height: 24px; margin-top: 20px; @@ -253,7 +250,7 @@ footer { float: right; } - h4 { + h3 { margin: 50px 0 0; text-align: center; } @@ -295,7 +292,7 @@ footer { padding: 20px; text-shadow: none; margin: 0 20px; - background-color: #3d3d3d; + background-color: #171717; @include border-radius(0 0 5px 5px); @include box-shadow(0 5px 30px rgba(0,0,0,.3)); } @@ -333,7 +330,7 @@ footer { .free-hosting { .pane { - background-color: #444; + background-color: #3e3e3e; @include border-radius(10px); text-shadow: none; position: relative; @@ -483,7 +480,7 @@ aside { @include border-radius(5px); /*border: 1px solid #333;*/ @include box-shadow(0 1px 3px rgba(0,0,0,.3), inset 0 1px 1px rgba(255,255,255,.5)); - background-color: #777; + background-color: #767676; } a:hover { @@ -597,7 +594,7 @@ article h2:first-child { margin-top: 0; } .post-meta { padding: 5px 0; - color: #aaa; + color: #c0c0c0; font-weight: 600; text-shadow: 0 -1px 0 #000; } @@ -635,7 +632,7 @@ p > nobr > code, li > code, h5 > code, .note > code { - background-color: #333; + background-color: #2b2b2b; color: #fff; @include border-radius(5px); @include box-shadow(inset 0 1px 10px rgba(0,0,0,.3), @@ -971,3 +968,18 @@ code.output { display: inline !important; } } + + +/* Helper class taken from Bootstrap. + Hides an element to all devices except screen readers. +*/ +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} diff --git a/site/index.html b/site/index.html index d0dfaeab3..a8bda7428 100644 --- a/site/index.html +++ b/site/index.html @@ -38,7 +38,7 @@ overview: true
-

Get up and running in seconds.

+

Get up and running in seconds.

Quick-start Instructions

From 7655b533c9297c224e50eb00d75e5967fc54d4f5 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sat, 29 Nov 2014 10:51:30 -0800 Subject: [PATCH 127/407] Allow documents to set `published` in front matter --- lib/jekyll/collection.rb | 13 ++++++++- test/source/_slides/non-outputted-slide.html | 7 +++++ test/test_document.rb | 28 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/source/_slides/non-outputted-slide.html diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index 73e480dd1..f768b836f 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -40,7 +40,7 @@ module Jekyll if Utils.has_yaml_header? full_path doc = Jekyll::Document.new(full_path, { site: site, collection: self }) doc.read - docs << doc + docs << doc if publisher.publish?(doc) else relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.") files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self) @@ -184,5 +184,16 @@ module Jekyll end end + + private + + # A Publisher object used to determine which documents should be + # added to the docs list + # + # Returns a Publisher object. + def publisher + @publisher ||= Publisher.new(site) + end + end end diff --git a/test/source/_slides/non-outputted-slide.html b/test/source/_slides/non-outputted-slide.html new file mode 100644 index 000000000..5eca15681 --- /dev/null +++ b/test/source/_slides/non-outputted-slide.html @@ -0,0 +1,7 @@ +--- + title: Non outputted slide + layout: slide + published: false +--- + +This should not be output diff --git a/test/test_document.rb b/test/test_document.rb index 57c14c223..ba2c4d8c7 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -237,6 +237,34 @@ class TestDocument < Test::Unit::TestCase end end + context "documents in a collection" do + setup do + @site = Site.new(Jekyll.configuration({ + "collections" => { + "slides" => { + "output" => true + } + }, + "source" => source_dir, + "destination" => dest_dir + })) + @site.process + @files = @site.collections["slides"].docs + end + + context "without output overrides" do + should "be output according to collection defaults" do + assert_not_nil @files.find { |doc| doc.relative_path == "_slides/example-slide-4.html" } + end + end + + context "with output overrides" do + should "be output according its front matter" do + assert_nil @files.find { |doc| doc.relative_path == "_slides/non-outputted-slide.html" } + end + end + end + context "a static file in a collection" do setup do @site = Site.new(Jekyll.configuration({ From c58ac78a5e4c0c3a5d27f1540e4763656edc8fbe Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Sun, 30 Nov 2014 18:46:45 -0800 Subject: [PATCH 128/407] Expose Publisher in Site --- lib/jekyll/collection.rb | 14 +------------- lib/jekyll/site.rb | 8 ++++---- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index f768b836f..b09a7ed93 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -40,7 +40,7 @@ module Jekyll if Utils.has_yaml_header? full_path doc = Jekyll::Document.new(full_path, { site: site, collection: self }) doc.read - docs << doc if publisher.publish?(doc) + docs << doc if site.publisher.publish?(doc) else relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.") files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self) @@ -183,17 +183,5 @@ module Jekyll {} end end - - - private - - # A Publisher object used to determine which documents should be - # added to the docs list - # - # Returns a Publisher object. - def publisher - @publisher ||= Publisher.new(site) - end - end end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 7b8a4a00a..2754a6e5b 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -497,6 +497,10 @@ module Jekyll override['full_rebuild'] || config['full_rebuild'] end + def publisher + @publisher ||= Publisher.new(self) + end + private def has_relative_page? @@ -517,9 +521,5 @@ module Jekyll name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2') name.gsub(/\s+/, '_') end - - def publisher - @publisher ||= Publisher.new(self) - end end end From f95d0ba84083dc1793cd47176db21e07ddf5aa81 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 5 Jan 2015 23:19:47 -0800 Subject: [PATCH 129/407] Update history to reflect merge of #3172 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index acc38791c..6182f4eac 100644 --- a/History.markdown +++ b/History.markdown @@ -16,6 +16,7 @@ * Generalize `Utils#slugify` for any scripts (#3047) * Added basic microdata to post template in site template (#3189) * Store log messages in an array of messages. (#3244) + * Allow collection documents to override `output` property in front matter (#3172) ### Bug Fixes From c4d617e6aa0e37647c90dd07b34e61615c021a68 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 7 Jan 2015 12:30:48 +0100 Subject: [PATCH 130/407] Fix nav items alignment when on multiple lines --- lib/site_template/_sass/_layout.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/site_template/_sass/_layout.scss b/lib/site_template/_sass/_layout.scss index def56f896..5a9efab2e 100644 --- a/lib/site_template/_sass/_layout.scss +++ b/lib/site_template/_sass/_layout.scss @@ -35,9 +35,9 @@ color: $text-color; line-height: $base-line-height; - // Gaps between nav items, but not on the first one - &:not(:first-child) { - margin-left: 20px; + // Gaps between nav items, but not on the last one + &:not(:last-child) { + margin-right: 20px; } } From d47b882af217e7e707e62127c7c3bfc5b44a1a1b Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 7 Jan 2015 14:27:17 -0800 Subject: [PATCH 131/407] Update history to reflect merge of #3264 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 6182f4eac..022794cc9 100644 --- a/History.markdown +++ b/History.markdown @@ -23,6 +23,7 @@ * Remove unneeded end tag for `link` in site template (#3236) * Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237) * Unescape `Document` output path (#2924) + * Fix nav items alignment when on multiple rows (#3264) ### Development Fixes From 54d0bf47e88f8a3ae789b330b78c425a27ca7b08 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Thu, 8 Jan 2015 15:10:53 +0300 Subject: [PATCH 132/407] Added per post excerpt_separator functionality, so you are able to specify :excerpt_separator (as well as just :excerpt) key direct inside the post YAML, to make an excerpt based on the value in the post. Tests were also added. --- .gitignore | 1 + lib/jekyll/excerpt.rb | 4 +++- lib/jekyll/post.rb | 10 +++++++++- site/_docs/posts.md | 10 ++++++++++ .../2015-01-08-post-excerpt-separator.markdown | 15 +++++++++++++++ test/test_generated_site.rb | 2 +- test/test_post.rb | 16 ++++++++++++++++ 7 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 test/source/_posts/2015-01-08-post-excerpt-separator.markdown diff --git a/.gitignore b/.gitignore index d9effd5b7..8c1da7227 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ gh-pages/ site/_site/ coverage .ruby-version +.ruby-gemset .sass-cache tmp/stackprof-* .jekyll-metadata diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index 41d4976c9..6e328a303 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -105,7 +105,9 @@ module Jekyll # # Returns excerpt String def extract_excerpt(post_content) - separator = site.config['excerpt_separator'] + separator = !post.excerpt_separator.empty? && + post.excerpt_separator || + site.config['excerpt_separator'] head, _, tail = post_content.to_s.partition(separator) "" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n") diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index c377e376e..89d1c01aa 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -23,6 +23,7 @@ module Jekyll ATTRIBUTES_FOR_LIQUID = EXCERPT_ATTRIBUTES_FOR_LIQUID + %w[ content excerpt + excerpt_separator ] # Post name validator. Post filenames must be like: @@ -118,6 +119,13 @@ module Jekyll data.fetch('title') { titleized_slug } end + # Public: the Post excerpt_separator, from the YAML Front-Matter or empty string + # + # Returns the post excerpt_separator + def excerpt_separator + data.fetch('excerpt_separator') { "" } + end + # Turns the post slug into a suitable title def titleized_slug slug.split('-').select {|w| w.capitalize! || w }.join(' ') @@ -307,7 +315,7 @@ module Jekyll end def generate_excerpt? - !(site.config['excerpt_separator'].to_s.empty?) + !site.config['excerpt_separator'].to_s.empty? || !excerpt_separator.empty? end end end diff --git a/site/_docs/posts.md b/site/_docs/posts.md index 504ea2fba..7afd88dc5 100644 --- a/site/_docs/posts.md +++ b/site/_docs/posts.md @@ -171,6 +171,16 @@ your `excerpt_separator` to `""`. Also, as with any output generated by Liquid tags, you can pass the `| strip_html` flag to remove any html tags in the output. This is particularly helpful if you wish to output a post excerpt as a `meta="description"` tag within the post `head`, or anywhere else having html tags along with the content is not desirable. +Additionally you are able to specify per-post `excerpt_separator` value if it is required just only the the selected post. Just specify the `excerpt_separator` with the same way as `excerpt` in the post's YAML head: + + --- + excerpt_separator: + --- + + Excerpt + + Out-of-excerpt + ## Highlighting code snippets Jekyll also has built-in support for syntax highlighting of code snippets using diff --git a/test/source/_posts/2015-01-08-post-excerpt-separator.markdown b/test/source/_posts/2015-01-08-post-excerpt-separator.markdown new file mode 100644 index 000000000..e8b7ddd9c --- /dev/null +++ b/test/source/_posts/2015-01-08-post-excerpt-separator.markdown @@ -0,0 +1,15 @@ +--- +layout: ~ +title: Post Excerpt Separator +excerpt_separator: "\n---\n" +--- + +First paragraph with [link ref][link]. + +Second paragraph + +--- + +Third paragraph + +[link]: http://www.jekyllrb.com/ diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index 0b157e85f..03669b904 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase end should "ensure post count is as expected" do - assert_equal 44, @site.posts.size + assert_equal 45, @site.posts.size end should "insert site.posts into the index" do diff --git a/test/test_post.rb b/test/test_post.rb index 2592b9185..1826674de 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -397,6 +397,22 @@ class TestPost < Test::Unit::TestCase end end + context "with page's excerpt_separator setting" do + setup do + file = "2015-01-08-post-excerpt-separator.markdown" + + @post.process(file) + @post.read_yaml(@source, file) + @post.transform + end + + should "respect given separator" do + assert @post.excerpt.include?("First paragraph"), "contains first paragraph" + assert @post.excerpt.include?("Second paragraph"), "contains second paragraph" + assert !@post.excerpt.include?("Third paragraph"), "does not contains third paragraph" + end + end + context "with custom excerpt" do setup do file = "2013-04-11-custom-excerpt.markdown" From e7c0e313a38190cc574420f242e14c89485760a5 Mon Sep 17 00:00:00 2001 From: Anna Debenham Date: Thu, 8 Jan 2015 18:39:27 +0000 Subject: [PATCH 133/407] Change collection documentation based on #223 Clarifying what happens if no YAML front matter exists. The current explanation says that Jekyll will generate a file without Front Matter, but it appears this isn't the case. I'm still not sure if this is the intended behaviour, but this clarifies how it currently works. --- site/_docs/collections.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/site/_docs/collections.md b/site/_docs/collections.md index a132dc6de..2acf7daef 100644 --- a/site/_docs/collections.md +++ b/site/_docs/collections.md @@ -37,7 +37,7 @@ collections: ### Step 2: Add your content Create a corresponding folder (e.g. `/_my_collection`) and add documents. -YAML Front Matter is read in as data if it exists, if not, then everything is just stuck in the Document's `content` attribute. +YAML Front Matter is read in as data if it exists, and everything after it is stuck in the Document's `content` attribute. If no YAML Front Matter is provided, Jekyll will not generate the file in your collection. Note: the folder must be named identically to the collection you defined in your `_config.yml` file, with the addition of the preceding `_` character. @@ -211,8 +211,7 @@ In addition to any YAML Front Matter provided in the document's corresponding fi

- The (unrendered) content of the document. If no YAML Front Matter is provided, - this is the entirety of the file contents. If YAML Front Matter + The (unrendered) content of the document. If no YAML Front Matter is provided, Jekyll will not generate the file in your collection. If YAML Front Matter is used, then this is all the contents of the file after the terminating `---` of the front matter.

From b92274b101abe67ade60bf78f5ce439334f105e8 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Fri, 9 Jan 2015 00:07:11 -0800 Subject: [PATCH 134/407] only strip newlines when rendering highlight blocks (#3265) --- lib/jekyll/tags/highlight.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb index b51712b65..e1ed4e54b 100644 --- a/lib/jekyll/tags/highlight.rb +++ b/lib/jekyll/tags/highlight.rb @@ -42,7 +42,7 @@ eos def render(context) prefix = context["highlighter_prefix"] || "" suffix = context["highlighter_suffix"] || "" - code = super.to_s.strip + code = super.to_s.gsub(/^\n+|\n+$/, '') is_safe = !!context.registers[:site].safe From bce46801820ca4ad2d0fc88e1a29783b164c6973 Mon Sep 17 00:00:00 2001 From: Paul Rayner Date: Fri, 9 Jan 2015 15:41:45 -0700 Subject: [PATCH 135/407] Add new AsciiDoc plugin gem to list of Jekyll plugins. --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 79349b734..0bcbe3ab4 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -514,6 +514,7 @@ You can find a few useful plugins at the following locations: - [Org-mode Converter](https://gist.github.com/abhiyerra/7377603): Org-mode converter for Jekyll. - [Customized Kramdown Converter](https://github.com/mvdbos/kramdown-with-pygments): Enable Pygments syntax highlighting for Kramdown-parsed fenced code blocks. - [Bigfootnotes Plugin](https://github.com/TheFox/jekyll-bigfootnotes): Enables big footnotes for Kramdown. +- [AsciiDoc Plugin](https://github.com/asciidoctor/jekyll-asciidoc): AsciiDoc convertor for Jekyll using [Asciidoctor](http://asciidoctor.org/). #### Filters From a0f2b5f944cee9648e5931bd6d2502ce74af6d84 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sat, 10 Jan 2015 03:58:02 +0300 Subject: [PATCH 136/407] get procedure for default excerpt separator for both cases site and page was moved to the post's specific method :excerpt_separator. --- lib/jekyll/excerpt.rb | 5 +---- lib/jekyll/post.rb | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index 6e328a303..347be2170 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -105,10 +105,7 @@ module Jekyll # # Returns excerpt String def extract_excerpt(post_content) - separator = !post.excerpt_separator.empty? && - post.excerpt_separator || - site.config['excerpt_separator'] - head, _, tail = post_content.to_s.partition(separator) + head, _, tail = post_content.to_s.partition(post.excerpt_separator) "" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n") end diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 89d1c01aa..c94d66b6a 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -119,11 +119,12 @@ module Jekyll data.fetch('title') { titleized_slug } end - # Public: the Post excerpt_separator, from the YAML Front-Matter or empty string + # Public: the Post excerpt_separator, from the YAML Front-Matter or site default + # excerpt_separator value # # Returns the post excerpt_separator def excerpt_separator - data.fetch('excerpt_separator') { "" } + data.fetch('excerpt_separator') { site.config['excerpt_separator'].to_s } end # Turns the post slug into a suitable title @@ -315,7 +316,7 @@ module Jekyll end def generate_excerpt? - !site.config['excerpt_separator'].to_s.empty? || !excerpt_separator.empty? + !excerpt_separator.empty? end end end From 8a9c48c7b426b8dcc4225ea5a88a6492369473ee Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 9 Jan 2015 23:33:21 -0800 Subject: [PATCH 137/407] Update history to reflect merge of #3277 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 022794cc9..e4731c161 100644 --- a/History.markdown +++ b/History.markdown @@ -40,6 +40,7 @@ * Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186) * Add a Resources link to tutorial on building dynamic navbars (#3185) * Semantic structure improvements to the post and page layouts (#3251) + * Add new AsciiDoc plugin to list of third-party plugins. (#3277) ## 2.5.3 / 2014-12-22 From cae9d96cc4ba43ae188a033f247e3dc58fcbf499 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 9 Jan 2015 23:51:34 -0800 Subject: [PATCH 138/407] Add test for stripping just newlines from code blocks. Ref #3275. --- test/test_tags.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_tags.rb b/test/test_tags.rb index bc4b48cd7..eb5477505 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -174,6 +174,21 @@ CONTENT end end + context "post content has highlight tag with preceding spaces" do + setup do + fill_post <<-EOS + + [,1] [,2] +[1,] FALSE TRUE +[2,] FALSE TRUE +EOS + end + + should "only strip the preceding newlines" do + assert_match %{
     [,1] [,2]}, @result
+    end
+  end
+
   context "simple post with markdown and pre tags" do
     setup do
       @content = <
Date: Fri, 9 Jan 2015 23:55:47 -0800
Subject: [PATCH 139/407] Add support for Windows line feeds too.

---
 lib/jekyll/tags/highlight.rb |  2 +-
 test/test_tags.rb            | 27 ++++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb
index e1ed4e54b..0305f1cfc 100644
--- a/lib/jekyll/tags/highlight.rb
+++ b/lib/jekyll/tags/highlight.rb
@@ -42,7 +42,7 @@ eos
       def render(context)
         prefix = context["highlighter_prefix"] || ""
         suffix = context["highlighter_suffix"] || ""
-        code = super.to_s.gsub(/^\n+|\n+$/, '')
+        code = super.to_s.gsub(/^(\n|\r)+|(\n|\r)+$/, '')
 
         is_safe = !!context.registers[:site].safe
 
diff --git a/test/test_tags.rb b/test/test_tags.rb
index eb5477505..c910d12b6 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -174,10 +174,35 @@ CONTENT
     end
   end
 
-  context "post content has highlight tag with preceding spaces" do
+  context "post content has highlight tag with preceding spaces & lines" do
     setup do
       fill_post <<-EOS
 
+
+     [,1] [,2]
+[1,] FALSE TRUE
+[2,] FALSE TRUE
+EOS
+    end
+
+    should "only strip the preceding newlines" do
+      assert_match %{
     [,1] [,2]}, @result
+    end
+  end
+
+  context "post content has highlight tag with preceding spaces & Windows-style newlines" do
+    setup do
+      fill_post "\r\n\r\n\r\n     [,1] [,2]"
+    end
+
+    should "only strip the preceding newlines" do
+      assert_match %{
     [,1] [,2]}, @result
+    end
+  end
+
+  context "post content has highlight tag with only preceding spaces" do
+    setup do
+      fill_post <<-EOS
      [,1] [,2]
 [1,] FALSE TRUE
 [2,] FALSE TRUE

From 730aedd0a3206388cfc8f2e2b4c6704ce9b1289f Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Fri, 9 Jan 2015 23:57:52 -0800
Subject: [PATCH 140/407] Add Rake's test loader because it is inconsistently
 installed.

---
 test/loader.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 test/loader.rb

diff --git a/test/loader.rb b/test/loader.rb
new file mode 100644
index 000000000..f2c9c0d19
--- /dev/null
+++ b/test/loader.rb
@@ -0,0 +1,44 @@
+# Yoinked lovingly from Rake's source code.
+#
+# Copyright (c) Jim Weirich
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+require 'rake'
+
+# Load the test files from the command line.
+argv = ARGV.select do |argument|
+  case argument
+  when /^-/ then
+    argument
+  when /\*/ then
+    FileList[argument].to_a.each do |file|
+      require File.expand_path file
+    end
+
+    false
+  else
+    require File.expand_path argument
+
+    false
+  end
+end
+
+ARGV.replace argv

From a6238c36d5300ef9d260a4e1144f1dfa973bd72e Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Fri, 9 Jan 2015 23:58:32 -0800
Subject: [PATCH 141/407] Fix script/test to be more cross-compatible with
 other platforms

---
 script/test | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/script/test b/script/test
index 52dc4b927..a6ae0f4d1 100755
--- a/script/test
+++ b/script/test
@@ -5,24 +5,11 @@
 #   script/test 
 
 if [ -z "$1" ]; then
-  TEST_FILES="./test/test_*.rb"
+  TEST_FILES=$(ruby -e "puts Dir.glob('test/test_*.rb')")
 else
   TEST_FILES="$@"
 fi
 
-# bundle exec gem env
-GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2)
-RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'")
-RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}"
-
-test -d "${RAKE_LIB_DIR}" || {
-  echo "No ${RAKE_LIB_DIR}. Installing Rake."
-  bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v
-}
-
 set -x
 
-time bundle exec ruby -I"lib:test" \
-  -I"${RAKE_LIB_DIR}" \
-  "${RAKE_LIB_DIR}/rake/rake_test_loader.rb" \
-  $TEST_FILES
+time bundle exec ruby -I"lib:test" -rloader $TEST_FILES

From 989639256d226d4f886b533e00b20d67d70b65cc Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sat, 10 Jan 2015 00:00:30 -0800
Subject: [PATCH 142/407] Update history to reflect merge of #3278 [ci skip]

---
 History.markdown | 1 +
 1 file changed, 1 insertion(+)

diff --git a/History.markdown b/History.markdown
index e4731c161..45dda9b82 100644
--- a/History.markdown
+++ b/History.markdown
@@ -24,6 +24,7 @@
   * Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237)
   * Unescape `Document` output path (#2924)
   * Fix nav items alignment when on multiple rows (#3264)
+  * Highlight: Only Strip Newlines/Carriage Returns, not Spaces (#3278)
 
 ### Development Fixes
 

From 0a4bd99e6bcab922bafdf1b6d102233f0a6d20b8 Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sat, 10 Jan 2015 00:05:03 -0800
Subject: [PATCH 143/407] Update history to reflect merge of #3271 [ci skip]

---
 History.markdown | 1 +
 1 file changed, 1 insertion(+)

diff --git a/History.markdown b/History.markdown
index 45dda9b82..c7536af7f 100644
--- a/History.markdown
+++ b/History.markdown
@@ -42,6 +42,7 @@
   * Add a Resources link to tutorial on building dynamic navbars (#3185)
   * Semantic structure improvements to the post and page layouts (#3251)
   * Add new AsciiDoc plugin to list of third-party plugins. (#3277)
+  * Specify that all transformable collection documents must contain YAML front matter (#3271)
 
 ## 2.5.3 / 2014-12-22
 

From 4e9b0663be7ffcfe1b07f895fa2eea58ba4c81ab Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sat, 10 Jan 2015 00:09:18 -0800
Subject: [PATCH 144/407] Update history to reflect merge of #3279 [ci skip]

---
 History.markdown | 1 +
 1 file changed, 1 insertion(+)

diff --git a/History.markdown b/History.markdown
index c7536af7f..eed7a5a3e 100644
--- a/History.markdown
+++ b/History.markdown
@@ -33,6 +33,7 @@
   * Update rake task `site:publish` to fix minor bugs. (#3254)
   * Switch to shields.io for the README badges. (#3255)
   * Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261)
+  * Fix test script to be platform-independent (#3279)
 
 ### Site Enhancements
 

From 8b6a9d66ec3327d832dc03b267c3f45ebf014403 Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sat, 10 Jan 2015 00:12:40 -0800
Subject: [PATCH 145/407] Update history to reflect merge of #3258 [ci skip]

---
 History.markdown | 1 +
 1 file changed, 1 insertion(+)

diff --git a/History.markdown b/History.markdown
index eed7a5a3e..19fe30b87 100644
--- a/History.markdown
+++ b/History.markdown
@@ -34,6 +34,7 @@
   * Switch to shields.io for the README badges. (#3255)
   * Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261)
   * Fix test script to be platform-independent (#3279)
+  * Instead of symlinking `/tmp`, create and symlink a local `tmp` in the tests (#3258)
 
 ### Site Enhancements
 

From e2a5a9dbc16dd4793470d029a52aff84e2fefbd4 Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sat, 10 Jan 2015 00:14:34 -0800
Subject: [PATCH 146/407] Update history to reflect merge of #3256 [ci skip]

---
 History.markdown | 1 +
 1 file changed, 1 insertion(+)

diff --git a/History.markdown b/History.markdown
index 19fe30b87..4f954cb62 100644
--- a/History.markdown
+++ b/History.markdown
@@ -45,6 +45,7 @@
   * Semantic structure improvements to the post and page layouts (#3251)
   * Add new AsciiDoc plugin to list of third-party plugins. (#3277)
   * Specify that all transformable collection documents must contain YAML front matter (#3271)
+  * Assorted accessibility fixes (#3256)
 
 ## 2.5.3 / 2014-12-22
 

From 585a31d8aab0eb01a66b2b30ea57c17385589951 Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Sun, 17 Aug 2014 18:17:17 -0400
Subject: [PATCH 147/407] Support RDiscount 2.

Fixes #2747.
---
 Gemfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Gemfile b/Gemfile
index 2bc6abc32..5649d19fb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,7 +9,7 @@ gem 'rr', '~> 1.1'
 gem 'cucumber', '1.3.18'
 gem 'RedCloth', '~> 4.2'
 gem 'maruku', '~> 0.7.0'
-gem 'rdiscount', '~> 1.6'
+gem 'rdiscount', '~> 2.0'
 gem 'launchy', '~> 2.3'
 gem 'simplecov', '~> 0.9'
 gem 'simplecov-gem-adapter', '~> 1.0.1'

From 7c8e4d46ebd09b2128371cdbcc02a44563220ed0 Mon Sep 17 00:00:00 2001
From: Parker Moore 
Date: Mon, 29 Dec 2014 00:11:13 -0500
Subject: [PATCH 148/407] Fix up new output for RDiscount 2.

---
 test/test_rdiscount.rb | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb
index ed2c6f989..da9401cfb 100644
--- a/test/test_rdiscount.rb
+++ b/test/test_rdiscount.rb
@@ -16,7 +16,24 @@ class TestRdiscount < Test::Unit::TestCase
     end
 
     should "render toc" do
-      assert_equal "

Header 1

\n\n

Header 2

\n\n

\n

\n\n

", @markdown.convert("# Header 1\n\n## Header 2\n\n{:toc}").strip + toc = <<-TOC + +

Header 1

+ + +

Header 2

+ +

+ +

+TOC + assert_equal toc.strip, @markdown.convert("# Header 1\n\n## Header 2\n\n{:toc}").strip end end end From 244310fbaa1afae4ab13d0c93ab7458f4e4db3af Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 10 Jan 2015 01:53:40 -0800 Subject: [PATCH 149/407] Update history to reflect merge of #2767 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 4f954cb62..74e3e0e6f 100644 --- a/History.markdown +++ b/History.markdown @@ -6,6 +6,7 @@ * Drop support for Ruby 1.9.3. (#3235) * Upgrade to Liquid 3.0.0 (#3002) * Support Ruby v2.2 (#3234) + * Support RDiscount 2 (#2767) ### Minor Enhancements From f228b31c2e2d9138a97fc2b593a26f541ed39f98 Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Sun, 11 Jan 2015 13:11:29 -0600 Subject: [PATCH 150/407] Update configuration.md Clarify ability to retain generated content in `destination` via the `keep_files` configuration directive. --- site/_docs/configuration.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index c9ddd915f..6fa4d79df 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -155,9 +155,11 @@ class="flag">flags
(specified on the command-line) that control them.
Destination folders are cleaned on site builds

The contents of <destination> are automatically - cleaned when the site is built. Files or folders that are not - created by your site will be removed. Do not use an important - location for <destination>; instead, use it as + cleaned, by default, when the site is built. Files or folders that are not + created by your site will be removed. The <keep_files> configuration directive can optionally retain generated content in `destination`. +

+

+ Do not use an important location for <destination>; instead, use it as a staging area and copy files from there to your web server.

From 312717b56dcdcf364b763f818925e36a125c63ad Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Sun, 11 Jan 2015 18:08:05 -0600 Subject: [PATCH 151/407] Update configuration.md Tweak and simplify language re: `keep_files` and `destination` directory. --- site/_docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 6fa4d79df..7a75bd696 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -156,7 +156,7 @@ class="flag">flags (specified on the command-line) that control them.

The contents of <destination> are automatically cleaned, by default, when the site is built. Files or folders that are not - created by your site will be removed. The <keep_files> configuration directive can optionally retain generated content in `destination`. + created by your site will be removed. Some files could be retained by specifying them within the <keep_files> configuration directive.

Do not use an important location for <destination>; instead, use it as From 965e3a1173173c6a0cb719b34a36e76e27172ccc Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 11 Jan 2015 16:21:22 -0800 Subject: [PATCH 152/407] Update history to reflect merge of #3288 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 74e3e0e6f..a7d1dac7f 100644 --- a/History.markdown +++ b/History.markdown @@ -47,6 +47,7 @@ * Add new AsciiDoc plugin to list of third-party plugins. (#3277) * Specify that all transformable collection documents must contain YAML front matter (#3271) * Assorted accessibility fixes (#3256) + * Update configuration docs to mention `keep_files` for `destination` (#3288) ## 2.5.3 / 2014-12-22 From 5e9706e2aafbe47bbf4bfe6ea11bf1248d47d777 Mon Sep 17 00:00:00 2001 From: Alan Scherger Date: Sun, 11 Jan 2015 20:42:34 -0800 Subject: [PATCH 153/407] Break when we successfully generate nav link. --- site/_includes/docs_ul.html | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_includes/docs_ul.html b/site/_includes/docs_ul.html index 366abe9d9..7cc54174e 100644 --- a/site/_includes/docs_ul.html +++ b/site/_includes/docs_ul.html @@ -13,6 +13,7 @@ {% for p in site.docs %} {% if p.url == item_url %}

  • {{ p.title }}
  • + {% break %} {% endif %} {% endfor %} From c26f040bcf99849cbed6322ec090e3d3f3c61491 Mon Sep 17 00:00:00 2001 From: Alan Scherger Date: Sun, 11 Jan 2015 21:04:00 -0800 Subject: [PATCH 154/407] Eliminate the need for prev_section and next_section metadata. --- site/_docs/assets.md | 2 - site/_docs/collections.md | 2 - site/_docs/configuration.md | 2 - site/_docs/continuous-integration.md | 2 - site/_docs/contributing.md | 2 - site/_docs/datafiles.md | 2 - site/_docs/deployment-methods.md | 2 - site/_docs/drafts.md | 2 - site/_docs/extras.md | 2 - site/_docs/frontmatter.md | 2 - site/_docs/github-pages.md | 2 - site/_docs/history.md | 1 - site/_docs/index.md | 1 - site/_docs/installation.md | 2 - site/_docs/migrations.md | 2 - site/_docs/pages.md | 2 - site/_docs/pagination.md | 2 - site/_docs/permalinks.md | 2 - site/_docs/plugins.md | 2 - site/_docs/posts.md | 2 - site/_docs/quickstart.md | 2 - site/_docs/resources.md | 2 - site/_docs/sites.md | 2 - site/_docs/structure.md | 2 - site/_docs/templates.md | 2 - site/_docs/troubleshooting.md | 2 - site/_docs/upgrading.md | 2 - site/_docs/usage.md | 2 - site/_docs/variables.md | 2 - site/_docs/windows.md | 2 - site/_includes/section_nav.html | 68 +++++++++++++++++++--------- 31 files changed, 47 insertions(+), 79 deletions(-) diff --git a/site/_docs/assets.md b/site/_docs/assets.md index c2965bdfe..e82ddb309 100644 --- a/site/_docs/assets.md +++ b/site/_docs/assets.md @@ -1,8 +1,6 @@ --- layout: docs title: Assets -prev_section: datafiles -next_section: migrations permalink: /docs/assets/ --- diff --git a/site/_docs/collections.md b/site/_docs/collections.md index 2acf7daef..fcda98ba8 100644 --- a/site/_docs/collections.md +++ b/site/_docs/collections.md @@ -1,8 +1,6 @@ --- layout: docs title: Collections -prev_section: variables -next_section: datafiles permalink: /docs/collections/ --- diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 7a75bd696..f7ca43e14 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -1,8 +1,6 @@ --- layout: docs title: Configuration -prev_section: structure -next_section: frontmatter permalink: /docs/configuration/ --- diff --git a/site/_docs/continuous-integration.md b/site/_docs/continuous-integration.md index 0e2b3a5cf..5e8a700ba 100644 --- a/site/_docs/continuous-integration.md +++ b/site/_docs/continuous-integration.md @@ -1,8 +1,6 @@ --- layout: docs title: Continuous Integration -prev_section: deployment-methods -next_section: troubleshooting permalink: /docs/continuous-integration/ --- diff --git a/site/_docs/contributing.md b/site/_docs/contributing.md index e3dbe807a..9f4a334ff 100644 --- a/site/_docs/contributing.md +++ b/site/_docs/contributing.md @@ -1,8 +1,6 @@ --- layout: docs title: Contributing -prev_section: upgrading -next_section: history permalink: /docs/contributing/ --- diff --git a/site/_docs/datafiles.md b/site/_docs/datafiles.md index 7088fec46..7f54a2795 100644 --- a/site/_docs/datafiles.md +++ b/site/_docs/datafiles.md @@ -1,8 +1,6 @@ --- layout: docs title: Data Files -prev_section: collections -next_section: assets permalink: /docs/datafiles/ --- diff --git a/site/_docs/deployment-methods.md b/site/_docs/deployment-methods.md index 2ab929b22..ddf571d4d 100644 --- a/site/_docs/deployment-methods.md +++ b/site/_docs/deployment-methods.md @@ -1,8 +1,6 @@ --- layout: docs title: Deployment methods -prev_section: github-pages -next_section: continuous-integration permalink: /docs/deployment-methods/ --- diff --git a/site/_docs/drafts.md b/site/_docs/drafts.md index 959964d0b..2f2f12b52 100644 --- a/site/_docs/drafts.md +++ b/site/_docs/drafts.md @@ -1,8 +1,6 @@ --- layout: docs title: Working with drafts -prev_section: posts -next_section: pages permalink: /docs/drafts/ --- diff --git a/site/_docs/extras.md b/site/_docs/extras.md index 5bdf2c73c..2af6a3059 100644 --- a/site/_docs/extras.md +++ b/site/_docs/extras.md @@ -1,8 +1,6 @@ --- layout: docs title: Extras -prev_section: plugins -next_section: github-pages permalink: /docs/extras/ --- diff --git a/site/_docs/frontmatter.md b/site/_docs/frontmatter.md index 998be5440..9ce032dfd 100644 --- a/site/_docs/frontmatter.md +++ b/site/_docs/frontmatter.md @@ -1,8 +1,6 @@ --- layout: docs title: Front Matter -prev_section: configuration -next_section: posts permalink: /docs/frontmatter/ --- diff --git a/site/_docs/github-pages.md b/site/_docs/github-pages.md index 83af0b3cc..eac7d1ead 100644 --- a/site/_docs/github-pages.md +++ b/site/_docs/github-pages.md @@ -1,8 +1,6 @@ --- layout: docs title: GitHub Pages -prev_section: extras -next_section: deployment-methods permalink: /docs/github-pages/ --- diff --git a/site/_docs/history.md b/site/_docs/history.md index 6485dadae..01b77d273 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -2,7 +2,6 @@ layout: docs title: History permalink: "/docs/history/" -prev_section: contributing --- ## 2.5.3 / 2014-12-22 diff --git a/site/_docs/index.md b/site/_docs/index.md index 27b2da25d..633d75349 100644 --- a/site/_docs/index.md +++ b/site/_docs/index.md @@ -1,7 +1,6 @@ --- layout: docs title: Welcome -next_section: quickstart permalink: /docs/home/ --- diff --git a/site/_docs/installation.md b/site/_docs/installation.md index 058879e9e..0f4398b34 100644 --- a/site/_docs/installation.md +++ b/site/_docs/installation.md @@ -1,8 +1,6 @@ --- layout: docs title: Installation -prev_section: quickstart -next_section: usage permalink: /docs/installation/ --- diff --git a/site/_docs/migrations.md b/site/_docs/migrations.md index a080c6c6e..0544341ac 100644 --- a/site/_docs/migrations.md +++ b/site/_docs/migrations.md @@ -1,8 +1,6 @@ --- layout: docs title: Blog migrations -prev_section: assets -next_section: templates permalink: /docs/migrations/ --- diff --git a/site/_docs/pages.md b/site/_docs/pages.md index ea59649e9..d3008daf5 100644 --- a/site/_docs/pages.md +++ b/site/_docs/pages.md @@ -1,8 +1,6 @@ --- layout: docs title: Creating pages -prev_section: drafts -next_section: variables permalink: /docs/pages/ --- diff --git a/site/_docs/pagination.md b/site/_docs/pagination.md index 245ba36f3..c2662f04d 100644 --- a/site/_docs/pagination.md +++ b/site/_docs/pagination.md @@ -1,8 +1,6 @@ --- layout: docs title: Pagination -prev_section: permalinks -next_section: plugins permalink: /docs/pagination/ --- diff --git a/site/_docs/permalinks.md b/site/_docs/permalinks.md index dbcee2e27..7a47cc68e 100644 --- a/site/_docs/permalinks.md +++ b/site/_docs/permalinks.md @@ -1,8 +1,6 @@ --- layout: docs title: Permalinks -prev_section: templates -next_section: pagination permalink: /docs/permalinks/ --- diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 0bcbe3ab4..cf0aab6e1 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -1,8 +1,6 @@ --- layout: docs title: Plugins -prev_section: pagination -next_section: extras permalink: /docs/plugins/ --- diff --git a/site/_docs/posts.md b/site/_docs/posts.md index 504ea2fba..b1508c3e4 100644 --- a/site/_docs/posts.md +++ b/site/_docs/posts.md @@ -1,8 +1,6 @@ --- layout: docs title: Writing posts -prev_section: frontmatter -next_section: drafts permalink: /docs/posts/ --- diff --git a/site/_docs/quickstart.md b/site/_docs/quickstart.md index 66cd94502..666ac03dc 100644 --- a/site/_docs/quickstart.md +++ b/site/_docs/quickstart.md @@ -1,8 +1,6 @@ --- layout: docs title: Quick-start guide -prev_section: home -next_section: installation permalink: /docs/quickstart/ --- diff --git a/site/_docs/resources.md b/site/_docs/resources.md index 6acba8377..71447b53b 100644 --- a/site/_docs/resources.md +++ b/site/_docs/resources.md @@ -1,8 +1,6 @@ --- layout: docs title: Resources -prev_section: sites -next_section: upgrading permalink: /docs/resources/ --- diff --git a/site/_docs/sites.md b/site/_docs/sites.md index 4e57aba79..c11da820e 100644 --- a/site/_docs/sites.md +++ b/site/_docs/sites.md @@ -1,8 +1,6 @@ --- layout: docs title: Sites using Jekyll -prev_section: troubleshooting -next_section: resources permalink: /docs/sites/ --- diff --git a/site/_docs/structure.md b/site/_docs/structure.md index 2dca3e6bb..848f1cce9 100644 --- a/site/_docs/structure.md +++ b/site/_docs/structure.md @@ -1,8 +1,6 @@ --- layout: docs title: Directory structure -prev_section: usage -next_section: configuration permalink: /docs/structure/ --- diff --git a/site/_docs/templates.md b/site/_docs/templates.md index c0825702f..12a70fc4e 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -1,8 +1,6 @@ --- layout: docs title: Templates -prev_section: migrations -next_section: permalinks permalink: /docs/templates/ --- diff --git a/site/_docs/troubleshooting.md b/site/_docs/troubleshooting.md index 4bb12be83..87da91fbf 100644 --- a/site/_docs/troubleshooting.md +++ b/site/_docs/troubleshooting.md @@ -1,8 +1,6 @@ --- layout: docs title: Troubleshooting -prev_section: deployment-methods -next_section: sites permalink: /docs/troubleshooting/ --- diff --git a/site/_docs/upgrading.md b/site/_docs/upgrading.md index 3a3f16701..879546c67 100644 --- a/site/_docs/upgrading.md +++ b/site/_docs/upgrading.md @@ -1,8 +1,6 @@ --- layout: docs title: Upgrading -prev_section: resources -next_section: contributing permalink: /docs/upgrading/ --- diff --git a/site/_docs/usage.md b/site/_docs/usage.md index 7d2d68e9f..01af33c52 100644 --- a/site/_docs/usage.md +++ b/site/_docs/usage.md @@ -1,8 +1,6 @@ --- layout: docs title: Basic Usage -prev_section: installation -next_section: structure permalink: /docs/usage/ --- diff --git a/site/_docs/variables.md b/site/_docs/variables.md index 1c62bf833..628a9904b 100644 --- a/site/_docs/variables.md +++ b/site/_docs/variables.md @@ -1,8 +1,6 @@ --- layout: docs title: Variables -prev_section: pages -next_section: collections permalink: /docs/variables/ --- diff --git a/site/_docs/windows.md b/site/_docs/windows.md index 81e909c9d..7642592c9 100644 --- a/site/_docs/windows.md +++ b/site/_docs/windows.md @@ -1,8 +1,6 @@ --- layout: docs title: Jekyll on Windows -prev_section: configuration -next_section: posts permalink: /docs/windows/ --- diff --git a/site/_includes/section_nav.html b/site/_includes/section_nav.html index edba19318..c7b606472 100644 --- a/site/_includes/section_nav.html +++ b/site/_includes/section_nav.html @@ -1,22 +1,48 @@ -
    -
    - {% if page.prev_section != null %} - - {% else %} - Back - {% endif %} -
    -
    - {% if page.next_section != null %} - - {% else %} - Next - {% endif %} -
    -
    -
    +{% comment %} +Lets turn our yaml into a structured list of documents without titles. +{% endcomment %} +{% assign docs = site.data.docs | map: 'docs' %} +{% capture document_array_string %} +{% for doc in docs %} + {% assign last_last = forloop.last %} + {% for title in doc %} + {{title}}{% unless forloop.last and last_last %},{% endunless %} + {% endfor %} +{% endfor %} +{% endcapture %} +{% assign document_array = document_array_string | strip_newlines | split: ',' %} + +{% comment %} +Because this is built for every page, lets find where we are in the document list by comparing url strings. +Then if there's something previous or next, lets build links to it. +Note: When arrays are accessed directly, they are zero based. +{% endcomment %} + +{% for document in document_array %} + {% assign document_url = document | prepend:"/docs/" | append:"/" %} + {% if document_url == page.url %} +
    +
    + {% if forloop.first %} + Back + {% else %} + {% assign previous = forloop.index0 | minus: 1 %} + {% assign previous_page = document_array[previous] | prepend:"/docs/" | append:"/" %} + + {% endif %} +
    +
    + {% if forloop.last %} + Next + {% else %} + {% assign next = forloop.index0 | plus: 1 %} + {% assign next_page = document_array[next] | prepend:"/docs/" | append:"/" %} + + {% endif %} +
    +
    +
    + {% break %} + {% endif %} +{% endfor %} \ No newline at end of file From 7439d303c4a86a3ae491691fac632560351444a3 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 12 Jan 2015 00:34:06 -0800 Subject: [PATCH 155/407] Update history to reflect merge of #3291 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index a7d1dac7f..f61ca57ae 100644 --- a/History.markdown +++ b/History.markdown @@ -48,6 +48,7 @@ * Specify that all transformable collection documents must contain YAML front matter (#3271) * Assorted accessibility fixes (#3256) * Update configuration docs to mention `keep_files` for `destination` (#3288) + * Break when we successfully generate nav link to save CPU cycles. (#3291) ## 2.5.3 / 2014-12-22 From e7dcc2424ab4c7adb7356b8a7f7bf2c8e384ec94 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 12 Jan 2015 00:37:33 -0800 Subject: [PATCH 156/407] Don't copy the .sass-cache to the gh-pages dir. --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 31434cd41..56d51815b 100644 --- a/Rakefile +++ b/Rakefile @@ -195,6 +195,7 @@ namespace :site do gh-pages/. gh-pages/.. gh-pages/.git + gh-pages/.gitignore ] FileList["gh-pages/{*,.*}"].exclude(*purge_exclude).each do |path| sh "rm -rf #{path}" @@ -206,6 +207,7 @@ namespace :site do site/. site/.. site/.jekyll-metadata + site/.sass-cache site/_site ] FileList["site/{*,.*}"].exclude(*copy_exclude).each do |path| From 60921132c6896a8ce90ffa6ec1ffb415bdc745c4 Mon Sep 17 00:00:00 2001 From: Sylvester Keil Date: Fri, 19 Dec 2014 15:18:05 +0100 Subject: [PATCH 157/407] Preserve original mtime when copying static files --- lib/jekyll/static_file.rb | 1 + test/test_site.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 02500b1d5..a8b09afca 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -81,6 +81,7 @@ module Jekyll FileUtils.mkdir_p(File.dirname(dest_path)) FileUtils.rm(dest_path) if File.exist?(dest_path) FileUtils.cp(path, dest_path) + File.utime(@@mtimes[path], @@mtimes[path], dest_path) true end diff --git a/test/test_site.rb b/test/test_site.rb index a6ef5af8e..2ebf0b022 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -132,7 +132,6 @@ class TestSite < Test::Unit::TestCase @site.metadata.clear @site.process - some_static_file = @site.static_files[0].path dest = File.expand_path(@site.static_files[0].destination(@site.dest)) mtime1 = File.stat(dest).mtime.to_i # first run must generate dest file @@ -144,16 +143,17 @@ class TestSite < Test::Unit::TestCase # simulate destination file deletion File.unlink dest + refute File.exists?(dest) sleep 1 @site.process mtime3 = File.stat(dest).mtime.to_i - assert_not_equal mtime2, mtime3 # must be regenerated and differ! + assert_equal mtime2, mtime3 # must be regenerated and with original mtime! sleep 1 @site.process mtime4 = File.stat(dest).mtime.to_i - assert_equal mtime3, mtime4 # no modifications, so must be the same + assert_equal mtime3, mtime4 # no modifications, so remain the same end should "setup plugins in priority order" do From d2b33144a7cea4895a1cd0308ad1cd2e04452f7b Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Mon, 12 Jan 2015 16:51:15 -0600 Subject: [PATCH 158/407] Update usage.md Sync Destination folder cleansing language with Configuration docs page (i.e. adding `keep_files` directive) --- site/_docs/usage.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/site/_docs/usage.md b/site/_docs/usage.md index 7d2d68e9f..115cf5e14 100644 --- a/site/_docs/usage.md +++ b/site/_docs/usage.md @@ -28,10 +28,13 @@ $ jekyll build --watch
    Destination folders are cleaned on site builds

    The contents of <destination> are automatically - cleaned when the site is built. Files or folders that are not - created by your site will be removed. Do not use an important - location for <destination>; instead, use it as - a staging area and copy files from there to your web server. + cleaned, by default, when the site is built. Files or folders that are not + created by your site will be removed. Some files could be retained + by specifying them within the <keep_files> configuration directive. +

    +

    + Do not use an important location for <destination>; + instead, use it as a staging area and copy files from there to your web server.

    From 7be49c99c15ca6b0a85835768f756654801d73e0 Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Mon, 12 Jan 2015 16:52:13 -0600 Subject: [PATCH 159/407] Update configuration.md Sync Destination folder cleansing language with Usage docs page (i.e. adding `keep_files` directive). --- site/_docs/configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 7a75bd696..488bb86e7 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -156,7 +156,8 @@ class="flag">flags (specified on the command-line) that control them.

    The contents of <destination> are automatically cleaned, by default, when the site is built. Files or folders that are not - created by your site will be removed. Some files could be retained by specifying them within the <keep_files> configuration directive. + created by your site will be removed. Some files could be retained + by specifying them within the <keep_files> configuration directive.

    Do not use an important location for <destination>; instead, use it as From aedff733e017f1ed07707fee5e6c65b50f16319a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 12 Jan 2015 15:08:15 -0800 Subject: [PATCH 160/407] Update history to reflect merge of #3296 [ci skip] --- History.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.markdown b/History.markdown index f61ca57ae..38d0ab455 100644 --- a/History.markdown +++ b/History.markdown @@ -47,7 +47,7 @@ * Add new AsciiDoc plugin to list of third-party plugins. (#3277) * Specify that all transformable collection documents must contain YAML front matter (#3271) * Assorted accessibility fixes (#3256) - * Update configuration docs to mention `keep_files` for `destination` (#3288) + * Update configuration docs to mention `keep_files` for `destination` (#3288, #3296) * Break when we successfully generate nav link to save CPU cycles. (#3291) ## 2.5.3 / 2014-12-22 From 12cbfa8cf43c1e638f228291cfecf2cbb5a8c58b Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Mon, 12 Jan 2015 18:20:17 -0600 Subject: [PATCH 161/407] Update usage.md Clarity. --- site/_docs/usage.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/site/_docs/usage.md b/site/_docs/usage.md index 115cf5e14..ae62a57f3 100644 --- a/site/_docs/usage.md +++ b/site/_docs/usage.md @@ -29,8 +29,9 @@ $ jekyll build --watch

    The contents of <destination> are automatically cleaned, by default, when the site is built. Files or folders that are not - created by your site will be removed. Some files could be retained - by specifying them within the <keep_files> configuration directive. + created by your site will be removed. Files and folders you wish to be retain + in <destination> may be specified within the <keep_files> + configuration directive.

    Do not use an important location for <destination>; From e378b2efd39ea09be6f9f70af5c5be07cc47b2c8 Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Mon, 12 Jan 2015 18:21:00 -0600 Subject: [PATCH 162/407] Update usage.md Correction; clarity. --- site/_docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/usage.md b/site/_docs/usage.md index ae62a57f3..7fb719eeb 100644 --- a/site/_docs/usage.md +++ b/site/_docs/usage.md @@ -29,7 +29,7 @@ $ jekyll build --watch

    The contents of <destination> are automatically cleaned, by default, when the site is built. Files or folders that are not - created by your site will be removed. Files and folders you wish to be retain + created by your site will be removed. Files and folders you wish to retain in <destination> may be specified within the <keep_files> configuration directive.

    From e13c800b3aa83b1adb1e9569dc32c4d025f97afd Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 12 Jan 2015 18:23:42 -0800 Subject: [PATCH 163/407] Update history to reflect merge of #3295 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 38d0ab455..d6b943dff 100644 --- a/History.markdown +++ b/History.markdown @@ -49,6 +49,7 @@ * Assorted accessibility fixes (#3256) * Update configuration docs to mention `keep_files` for `destination` (#3288, #3296) * Break when we successfully generate nav link to save CPU cycles. (#3291) + * Update usage docs to mention `keep_files` and a warning about `destination` cleaning (#3295) ## 2.5.3 / 2014-12-22 From b31d8a1ecdba138bbb20ce37383df01d59388706 Mon Sep 17 00:00:00 2001 From: Alan Scherger Date: Mon, 12 Jan 2015 22:05:25 -0800 Subject: [PATCH 164/407] more concise doc array creation --- site/_includes/section_nav.html | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/site/_includes/section_nav.html b/site/_includes/section_nav.html index c7b606472..2016997e0 100644 --- a/site/_includes/section_nav.html +++ b/site/_includes/section_nav.html @@ -1,25 +1,16 @@ {% comment %} -Lets turn our yaml into a structured list of documents without titles. +Map grabs the doc sections, giving us an array of arrays. Join, flattens all +the items to a comma delimited string. Split turns it into an array again. {% endcomment %} - -{% assign docs = site.data.docs | map: 'docs' %} -{% capture document_array_string %} -{% for doc in docs %} - {% assign last_last = forloop.last %} - {% for title in doc %} - {{title}}{% unless forloop.last and last_last %},{% endunless %} - {% endfor %} -{% endfor %} -{% endcapture %} -{% assign document_array = document_array_string | strip_newlines | split: ',' %} +{% assign docs = site.data.docs | map: 'docs' | join: ',' | split: ',' %} {% comment %} -Because this is built for every page, lets find where we are in the document list by comparing url strings. -Then if there's something previous or next, lets build links to it. -Note: When arrays are accessed directly, they are zero based. +Because this is built for every page, lets find where we are in the ordered +document list by comparing url strings. Then if there's something previous or +next, lets build a link to it. {% endcomment %} -{% for document in document_array %} +{% for document in docs %} {% assign document_url = document | prepend:"/docs/" | append:"/" %} {% if document_url == page.url %}
    @@ -28,7 +19,7 @@ Note: When arrays are accessed directly, they are zero based. Back {% else %} {% assign previous = forloop.index0 | minus: 1 %} - {% assign previous_page = document_array[previous] | prepend:"/docs/" | append:"/" %} + {% assign previous_page = docs[previous] | prepend:"/docs/" | append:"/" %} {% endif %}
    @@ -37,7 +28,7 @@ Note: When arrays are accessed directly, they are zero based. Next {% else %} {% assign next = forloop.index0 | plus: 1 %} - {% assign next_page = document_array[next] | prepend:"/docs/" | append:"/" %} + {% assign next_page = docs[next] | prepend:"/docs/" | append:"/" %} {% endif %}
    From 936c737a32769c45558da536e64d6aa9161535cd Mon Sep 17 00:00:00 2001 From: Ryan Burnette Date: Tue, 13 Jan 2015 02:21:28 -0500 Subject: [PATCH 165/407] Address #3298 --- lib/jekyll/filters.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index fca03437c..5972aad65 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -302,6 +302,8 @@ module Jekyll case input when Time input + when Date + input.to_time when String Time.parse(input) rescue Time.at(input.to_i) when Numeric From 588bba39adaa2ed001c693d4c5c74b7aaa296af0 Mon Sep 17 00:00:00 2001 From: Ryan Burnette Date: Tue, 13 Jan 2015 13:51:36 -0500 Subject: [PATCH 166/407] Add test for Date object in filters.rb --- test/test_filters.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/test_filters.rb b/test/test_filters.rb index 659b7a849..a8cd9737b 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -17,6 +17,7 @@ class TestFilters < Test::Unit::TestCase setup do @filter = JekyllFilter.new({"source" => source_dir, "destination" => dest_dir, "timezone" => "UTC"}) @sample_time = Time.utc(2013, 03, 27, 11, 22, 33) + @sample_date = Date.parse("2013-03-27") @time_as_string = "September 11, 2001 12:46:30 -0000" @time_as_numeric = 1399680607 @array_of_objects = [ @@ -80,6 +81,24 @@ class TestFilters < Test::Unit::TestCase end end + context "with Date object" do + should "format a date with short format" do + assert_equal "27 Mar 2013", @filter.date_to_string(@sample_date) + end + + should "format a date with long format" do + assert_equal "27 March 2013", @filter.date_to_long_string(@sample_date) + end + + should "format a time with xmlschema" do + assert_equal "2013-03-27T00:00:00+00:00", @filter.date_to_xmlschema(@sample_date) + end + + should "format a time according to RFC-822" do + assert_equal "Wed, 27 Mar 2013 00:00:00 +0000", @filter.date_to_rfc822(@sample_date) + end + end + context "with String object" do should "format a date with short format" do assert_equal "11 Sep 2001", @filter.date_to_string(@time_as_string) From 80465efff7485bdf9522c3bda3069ee761e09367 Mon Sep 17 00:00:00 2001 From: Ryan Burnette Date: Tue, 13 Jan 2015 13:51:47 -0500 Subject: [PATCH 167/407] Require date in filters.rb --- lib/jekyll/filters.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 5972aad65..e76fa7550 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -1,5 +1,6 @@ require 'uri' require 'json' +require 'date' module Jekyll module Filters From 5b50687e221beb58e7f8cf9b38524d017242f72a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 13 Jan 2015 12:01:11 -0800 Subject: [PATCH 168/407] Update history to reflect merge of #3299 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index d6b943dff..5f344c3f7 100644 --- a/History.markdown +++ b/History.markdown @@ -21,6 +21,7 @@ ### Bug Fixes + * `time()`pre-filter method should accept a `Date` object (#3299) * Remove unneeded end tag for `link` in site template (#3236) * Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237) * Unescape `Document` output path (#2924) From b2e114ed5b67767493fdb784d2826567cbb18607 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 13 Jan 2015 13:14:25 -0800 Subject: [PATCH 169/407] Update history to reflect merge of #3292 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 5f344c3f7..7997d0616 100644 --- a/History.markdown +++ b/History.markdown @@ -51,6 +51,7 @@ * Update configuration docs to mention `keep_files` for `destination` (#3288, #3296) * Break when we successfully generate nav link to save CPU cycles. (#3291) * Update usage docs to mention `keep_files` and a warning about `destination` cleaning (#3295) + * Add logic to automatically generate the `next_section` and `prev_section` navigation items (#3292) ## 2.5.3 / 2014-12-22 From 59e1e2dd8408fc4c0228e050a43ff38b63234813 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Tue, 13 Jan 2015 19:02:42 -0600 Subject: [PATCH 170/407] Update history to reflect merge of #3220 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 7997d0616..00dc1a039 100644 --- a/History.markdown +++ b/History.markdown @@ -18,6 +18,7 @@ * Added basic microdata to post template in site template (#3189) * Store log messages in an array of messages. (#3244) * Allow collection documents to override `output` property in front matter (#3172) + * Keep file modification times between builds for static files (#3220) ### Bug Fixes From 99ae1023b4bc7c7cab18f8af4e384e8eee85da16 Mon Sep 17 00:00:00 2001 From: Jordon Bedwell Date: Wed, 14 Jan 2015 05:45:49 -0600 Subject: [PATCH 171/407] Fix bad tabbing. --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8ba31005..d7960ce72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ rvm: - 2.0 env: matrix: - - TEST_SUITE=test - - TEST_SUITE=cucumber + - TEST_SUITE=test + - TEST_SUITE=cucumber before_script: bundle update script: script/cibuild notifications: @@ -16,9 +16,9 @@ notifications: on_success: change on_failure: change channels: - - irc.freenode.org#jekyll + - irc.freenode.org#jekyll template: - - "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}" + - "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}" email: on_success: never on_failure: never From 8e7d40ed909247ed10ca5ee439d5e6a3abfaa4d7 Mon Sep 17 00:00:00 2001 From: Jordon Bedwell Date: Wed, 14 Jan 2015 05:59:12 -0600 Subject: [PATCH 172/407] Seriously, why was vendor/ not in the .gitignore? --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 36da96562..f5ad5bc24 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ coverage .sass-cache tmp/* .jekyll-metadata +/vendor From 2547df81a154fafeb03a49870077b2ba67e26dd2 Mon Sep 17 00:00:00 2001 From: Jordon Bedwell Date: Wed, 14 Jan 2015 05:59:40 -0600 Subject: [PATCH 173/407] Allow test to be aliased as spec. --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 56d51815b..0b52c85d2 100644 --- a/Rakefile +++ b/Rakefile @@ -89,6 +89,7 @@ end multitask :default => [:test, :features] +task :spec => :test require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' From 3cb0f4f59004b45cbe8c8daa860a3da151c8667c Mon Sep 17 00:00:00 2001 From: Adam Richeimer Date: Wed, 14 Jan 2015 11:20:03 -0800 Subject: [PATCH 174/407] Formatting fixes - Add command to list of types of plugins - Made "command" plural to be consistent with other types - Made the types into links within the page --- site/_docs/plugins.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index cf0aab6e1..36173caf8 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -53,9 +53,10 @@ You have 3 options for installing plugins: In general, plugins you make will fall into one of three categories: -1. Generators -2. Converters -3. Tags +1. [Generators](#Generators) +2. [Converters](#Converters) +3. [Commands](#Commands) +4. [Tags](#Tags) ## Generators @@ -248,7 +249,7 @@ In our example, `UpcaseConverter#matches` checks if our filename extension is simply uppercasing the entire content string. Finally, when it saves the page, it will do so with a `.html` extension. -## Command +## Commands As of version 2.5.0, Jekyll can be extended with plugins which provide subcommands for the `jekyll` executable. This is possible by including the From b1fd7377fd00962d5abcb92e6a8e3c4acb3b5e22 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 14 Jan 2015 15:07:09 -0800 Subject: [PATCH 175/407] Update history to reflect merge of #3306 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 00dc1a039..67fdb9631 100644 --- a/History.markdown +++ b/History.markdown @@ -53,6 +53,7 @@ * Break when we successfully generate nav link to save CPU cycles. (#3291) * Update usage docs to mention `keep_files` and a warning about `destination` cleaning (#3295) * Add logic to automatically generate the `next_section` and `prev_section` navigation items (#3292) + * Some small fixes for the Plugins TOC. (#3306) ## 2.5.3 / 2014-12-22 From 60da4ef010a129cebff0dec888a9d0bc5b60c478 Mon Sep 17 00:00:00 2001 From: Mads Ohm Larsen Date: Thu, 15 Jan 2015 22:04:00 +0100 Subject: [PATCH 176/407] Fix weird spacing --- CONTRIBUTING.markdown | 2 +- History.markdown | 2 +- benchmark/string-replacement | 4 ++-- lib/site_template/_includes/footer.html | 10 +++++----- lib/site_template/_layouts/post.html | 2 +- site/_sass/_style.scss | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.markdown b/CONTRIBUTING.markdown index 94533415d..8bd2febee 100644 --- a/CONTRIBUTING.markdown +++ b/CONTRIBUTING.markdown @@ -67,7 +67,7 @@ You can find the documentation for jekyllrb.com in the [site](https://github.com/jekyll/jekyll/tree/master/site) directory of Jekyll's repo on GitHub.com. -All documentation pull requests should be directed at `master`. Pull +All documentation pull requests should be directed at `master`. Pull requests directed at another branch will not be accepted. The [Jekyll wiki](https://github.com/jekyll/jekyll/wiki) on GitHub diff --git a/History.markdown b/History.markdown index 67fdb9631..a1eb3aa18 100644 --- a/History.markdown +++ b/History.markdown @@ -538,7 +538,7 @@ * Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy looking up of variable values in a Liquid context. (#2253) * Remove literal lang name from class (#2292) - * Return `utf-8` encoding in header for webrick error page response (#2289) + * Return `utf-8` encoding in header for webrick error page response (#2289) * Make template site easier to customize (#2268) * Add two-digit year to permalink template option (#2301) * Add `site.documents` to Liquid payload (list of all docs) (#2295) diff --git a/benchmark/string-replacement b/benchmark/string-replacement index 137153760..36de613c3 100644 --- a/benchmark/string-replacement +++ b/benchmark/string-replacement @@ -8,6 +8,6 @@ Benchmark.ips do |x| x.report('#tr') { str.tr('some', 'a') } x.report('#gsub') { str.gsub('some', 'a') } x.report('#gsub!') { str.gsub!('some', 'a') } - x.report('#sub') { str.sub('some', 'a') } - x.report('#sub!') { str.sub!('some', 'a') } + x.report('#sub') { str.sub('some', 'a') } + x.report('#sub!') { str.sub!('some', 'a') } end diff --git a/lib/site_template/_includes/footer.html b/lib/site_template/_includes/footer.html index be3976f7e..ee8246a5b 100644 --- a/lib/site_template/_includes/footer.html +++ b/lib/site_template/_includes/footer.html @@ -5,19 +5,19 @@ diff --git a/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown b/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown index 5a64cfc95..1e3e44cee 100644 --- a/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +++ b/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown @@ -15,5 +15,3 @@ greatest code a spin without having to clone a repository from git. Please take this prerelease for a spin and [let us know](https://github.com/jekyll/jekyll/issues/new) if you run into any issues! - - diff --git a/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown b/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown index 509571b36..634071582 100644 --- a/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +++ b/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown @@ -16,5 +16,3 @@ keep on writing without any problems. As always, you can find the full list of fixes in this release in the [change log](/docs/history/)! - - diff --git a/test/fixtures/broken_front_matter3.erb b/test/fixtures/broken_front_matter3.erb index 5fff53b75..0672ae433 100644 --- a/test/fixtures/broken_front_matter3.erb +++ b/test/fixtures/broken_front_matter3.erb @@ -4,4 +4,3 @@ test: good Real content starts here - diff --git a/test/source/+/%# +.md b/test/source/+/%# +.md index a850f4dce..18e9cccc2 100644 --- a/test/source/+/%# +.md +++ b/test/source/+/%# +.md @@ -1,6 +1,6 @@ --- layout: default -title : Page name with non-alphabetic character +title : Page name with non-alphabetic character --- Line 1 {{ page.title }} diff --git a/test/source/_posts/2008-02-02-published.textile b/test/source/_posts/2008-02-02-published.textile index 786514084..5b2428e48 100644 --- a/test/source/_posts/2008-02-02-published.textile +++ b/test/source/_posts/2008-02-02-published.textile @@ -5,4 +5,3 @@ category: publish_test --- This should be published. - diff --git a/test/source/deal.with.dots.html b/test/source/deal.with.dots.html index a69dac8c3..afe2aa11c 100644 --- a/test/source/deal.with.dots.html +++ b/test/source/deal.with.dots.html @@ -4,4 +4,3 @@ permalink: /deal.with.dots/ --- Let's test if jekyll deals properly with dots. - From 6bc3dee98dd996c04a3ef9c5a6309649c10e91a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joop=20Au=C3=A9?= Date: Sun, 22 Feb 2015 18:42:12 +0100 Subject: [PATCH 336/407] Changed doc link in template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the doc link in the template to link to /docs/home instead of / Signed-off-by: Joop Aué --- .../_posts/0000-00-00-welcome-to-jekyll.markdown.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb b/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb index 7b633992e..4e0dd691e 100644 --- a/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +++ b/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb @@ -18,8 +18,8 @@ print_hi('Tom') #=> prints 'Hi, Tom' to STDOUT. {% endhighlight %} -Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help]. +Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help]. -[jekyll]: http://jekyllrb.com +[jekyll-docs]: http://jekyllrb.com/docs/home [jekyll-gh]: https://github.com/jekyll/jekyll [jekyll-help]: https://github.com/jekyll/jekyll-help From 1923fc39df1c279a69b00c3a9f472a4d57b777f2 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 22 Feb 2015 21:20:57 -0800 Subject: [PATCH 337/407] Update history to reflect merge of #3497 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1ccfd93f8..2d57ad7bb 100644 --- a/History.markdown +++ b/History.markdown @@ -78,6 +78,7 @@ * Proof the site with CircleCI. (#3427) * Update LICENSE to 2015. (#3477) * Upgrade tests to use Minitest (#3492) + * Remove trailing whitespace (#3497) ### Site Enhancements From 6cc298d615f043861e195a87027d618dece76da4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 22 Feb 2015 21:21:31 -0800 Subject: [PATCH 338/407] Update history to reflect merge of #3496 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 2d57ad7bb..b50a42a74 100644 --- a/History.markdown +++ b/History.markdown @@ -61,6 +61,7 @@ * The highlight tag should only clip the newlines before and after the *entire* block, not in between (#3401) * highlight: fix problem with linenos and rouge. (#3436) * `Site#read_data_file`: read CSV's with proper file encoding (#3455) + * Ignore `.jekyll-metadata` in site template (#3496) ### Development Fixes From faa5a446ba3f63c4737a8d61d9f9170704b1ce20 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 23 Feb 2015 01:25:42 -0800 Subject: [PATCH 339/407] Update history to reflect merge of #3502 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b50a42a74..e0fde4e95 100644 --- a/History.markdown +++ b/History.markdown @@ -62,6 +62,7 @@ * highlight: fix problem with linenos and rouge. (#3436) * `Site#read_data_file`: read CSV's with proper file encoding (#3455) * Ignore `.jekyll-metadata` in site template (#3496) + * Template: Point documentation link to the documentation pages (#3502) ### Development Fixes From 5c388309b29a8822b1bb50807b770aaa692ef438 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 23 Feb 2015 01:25:58 -0800 Subject: [PATCH 340/407] Spacing. [ci skip] --- .../_posts/0000-00-00-welcome-to-jekyll.markdown.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb b/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb index 4e0dd691e..945562f4d 100644 --- a/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +++ b/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb @@ -20,6 +20,6 @@ print_hi('Tom') Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help]. -[jekyll-docs]: http://jekyllrb.com/docs/home +[jekyll-docs]: http://jekyllrb.com/docs/home [jekyll-gh]: https://github.com/jekyll/jekyll [jekyll-help]: https://github.com/jekyll/jekyll-help From 13f822787783fa7a16e16d7468969054b7293e6c Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Tue, 24 Feb 2015 22:04:49 +0100 Subject: [PATCH 341/407] Implemented the "Improve this page" feature. #3495 Created an "Improve this page" link for all the documentation headers. The feature uses the fa-pencil icon of font awesome. Improvement over #3504(closed). See issue #3495 for more information. Signed-off-by: Martin Jorn Rogalla --- site/_layouts/docs.html | 3 +++ site/_sass/_font-awesome.scss | 3 +++ site/_sass/_style.scss | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/site/_layouts/docs.html b/site/_layouts/docs.html index a0a8a5c14..d4d080263 100644 --- a/site/_layouts/docs.html +++ b/site/_layouts/docs.html @@ -9,6 +9,9 @@ layout: default
    +

    {{ page.title }}

    {{ content }} {% include section_nav.html %} diff --git a/site/_sass/_font-awesome.scss b/site/_sass/_font-awesome.scss index 24ae2b613..d90676c2b 100644 --- a/site/_sass/_font-awesome.scss +++ b/site/_sass/_font-awesome.scss @@ -20,3 +20,6 @@ .fa-link:before { content: "\f0c1"; } +.fa-pencil:before { + content: "\f040"; +} diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss index 98ebebaaf..154887dcd 100644 --- a/site/_sass/_style.scss +++ b/site/_sass/_style.scss @@ -528,6 +528,12 @@ aside { } } +.improve { + margin-top: 0; + padding: 25px 0 0; + font-size: 16px; +} + .docs-nav-mobile select { color: #000; width: 100%; From e2306ed79bf9f01bbee83608c2892b80185ba557 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Tue, 24 Feb 2015 22:12:05 +0100 Subject: [PATCH 342/407] Removed unnecessary margin and simplified padding. Signed-off-by: Martin Jorn Rogalla --- site/_sass/_style.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss index 154887dcd..0b8ff267d 100644 --- a/site/_sass/_style.scss +++ b/site/_sass/_style.scss @@ -529,8 +529,7 @@ aside { } .improve { - margin-top: 0; - padding: 25px 0 0; + padding-top: 25px; font-size: 16px; } From a4db7ec63c4692ff7d279955110ac11a6f794fb2 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Wed, 25 Feb 2015 00:00:57 +0100 Subject: [PATCH 343/407] Put the pencil icon in front of the improve link. Signed-off-by: Martin Jorn Rogalla --- site/_layouts/docs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_layouts/docs.html b/site/_layouts/docs.html index d4d080263..5388a213f 100644 --- a/site/_layouts/docs.html +++ b/site/_layouts/docs.html @@ -10,7 +10,7 @@ layout: default

    {{ page.title }}

    {{ content }} From 422fd7d3043919f14d3acae1e5b73be7efc43697 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Tue, 24 Feb 2015 20:30:18 -0800 Subject: [PATCH 344/407] Use `fixture_site` for Document tests Should fix #3500 --- test/test_document.rb | 79 +++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 52 deletions(-) diff --git a/test/test_document.rb b/test/test_document.rb index 654532daf..b6160bdc4 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -4,11 +4,9 @@ class TestDocument < JekyllUnitTest context "a document in a collection" do setup do - @site = Site.new(Jekyll.configuration({ - "collections" => ["methods"], - "source" => source_dir, - "destination" => dest_dir - })) + @site = fixture_site({ + "collections" => ["methods"] + }) @site.process @document = @site.collections["methods"].docs.first end @@ -47,11 +45,9 @@ class TestDocument < JekyllUnitTest context "with YAML ending in three dots" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => ["methods"], - "source" => source_dir, - "destination" => dest_dir - })) + }) @site.process @document = @site.collections["methods"].docs.last end @@ -76,10 +72,8 @@ class TestDocument < JekyllUnitTest context "a document as part of a collection with frontmatter defaults" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => ["slides"], - "source" => source_dir, - "destination" => dest_dir, "defaults" => [{ "scope"=> {"path"=>"", "type"=>"slides"}, "values"=> { @@ -88,7 +82,7 @@ class TestDocument < JekyllUnitTest } } }] - })) + }) @site.process @document = @site.collections["slides"].docs.select{|d| d.is_a?(Document) }.first end @@ -106,10 +100,8 @@ class TestDocument < JekyllUnitTest context "a document as part of a collection with overriden default values" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => ["slides"], - "source" => source_dir, - "destination" => dest_dir, "defaults" => [{ "scope"=> {"path"=>"", "type"=>"slides"}, "values"=> { @@ -119,7 +111,7 @@ class TestDocument < JekyllUnitTest } } }] - })) + }) @site.process @document = @site.collections["slides"].docs[1] end @@ -138,10 +130,8 @@ class TestDocument < JekyllUnitTest context "a document as part of a collection with valid path" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => ["slides"], - "source" => source_dir, - "destination" => dest_dir, "defaults" => [{ "scope"=> {"path"=>"slides", "type"=>"slides"}, "values"=> { @@ -150,7 +140,7 @@ class TestDocument < JekyllUnitTest } } }] - })) + }) @site.process @document = @site.collections["slides"].docs.first end @@ -168,10 +158,8 @@ class TestDocument < JekyllUnitTest context "a document as part of a collection with invalid path" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => ["slides"], - "source" => source_dir, - "destination" => dest_dir, "defaults" => [{ "scope"=> {"path"=>"somepath", "type"=>"slides"}, "values"=> { @@ -180,7 +168,7 @@ class TestDocument < JekyllUnitTest } } }] - })) + }) @site.process @document = @site.collections["slides"].docs.first end @@ -195,11 +183,9 @@ class TestDocument < JekyllUnitTest context "a document in a collection with a custom permalink" do setup do - @site = Site.new(Jekyll.configuration({ - "collections" => ["slides"], - "source" => source_dir, - "destination" => dest_dir - })) + @site = fixture_site({ + "collections" => ["slides"] + }) @site.process @document = @site.collections["slides"].docs[2] @dest_file = dest_dir("slide/3/index.html") @@ -216,16 +202,14 @@ class TestDocument < JekyllUnitTest context "a document in a collection with custom filename permalinks" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => { "slides" => { "output" => true, "permalink" => "/slides/test/:name" } }, - "source" => source_dir, - "destination" => dest_dir - })) + }) @site.process @document = @site.collections["slides"].docs[0] end @@ -237,16 +221,14 @@ class TestDocument < JekyllUnitTest context "documents in a collection with custom title permalinks" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => { "slides" => { "output" => true, "permalink" => "/slides/:title" } }, - "source" => source_dir, - "destination" => dest_dir - })) + }) @site.process @document = @site.collections["slides"].docs[3] @document_without_slug = @site.collections["slides"].docs[4] @@ -268,15 +250,13 @@ class TestDocument < JekyllUnitTest context "documents in a collection" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => { "slides" => { "output" => true } }, - "source" => source_dir, - "destination" => dest_dir - })) + }) @site.process @files = @site.collections["slides"].docs end @@ -296,16 +276,13 @@ class TestDocument < JekyllUnitTest context "a static file in a collection" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => { "slides" => { "output" => true } - }, - "source" => source_dir, - "destination" => dest_dir, - "full_rebuild" => true - })) + } + }) @site.process @document = @site.collections["slides"].files.find { |doc| doc.relative_path == "_slides/octojekyll.png" } @dest_file = dest_dir("slides/octojekyll.png") @@ -330,15 +307,13 @@ class TestDocument < JekyllUnitTest context "a document in a collection with non-alphabetic file name" do setup do - @site = Site.new(Jekyll.configuration({ + @site = fixture_site({ "collections" => { "methods" => { "output" => true } }, - "source" => source_dir, - "destination" => dest_dir - })) + }) @site.process @document = @site.collections["methods"].docs.find { |doc| doc.relative_path == "_methods/escape-+ #%20[].md" } @dest_file = dest_dir("methods/escape-+ #%20[].html") From 5d97ec917474df4164c1945b0971e562a51c7253 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 24 Feb 2015 21:10:53 -0800 Subject: [PATCH 345/407] Update history to reflect merge of #3511 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e0fde4e95..47e40976d 100644 --- a/History.markdown +++ b/History.markdown @@ -81,6 +81,7 @@ * Update LICENSE to 2015. (#3477) * Upgrade tests to use Minitest (#3492) * Remove trailing whitespace (#3497) + * Use `fixture_site` for Document tests (#3511) ### Site Enhancements From a43d3d1dc89400dee6361f8a27c56ac0837e9145 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 24 Feb 2015 21:19:47 -0800 Subject: [PATCH 346/407] Make the .improve callout a light grey. --- site/_sass/_style.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss index 0b8ff267d..5980d248b 100644 --- a/site/_sass/_style.scss +++ b/site/_sass/_style.scss @@ -531,6 +531,9 @@ aside { .improve { padding-top: 25px; font-size: 16px; + a { + color: #999; + } } .docs-nav-mobile select { From 9e0bad72554bdc1e5c893854641b370b0d6e34fe Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 24 Feb 2015 21:21:14 -0800 Subject: [PATCH 347/407] Update history to reflect merge of #3510 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 47e40976d..43b296b6f 100644 --- a/History.markdown +++ b/History.markdown @@ -116,6 +116,7 @@ * Fix Twitter link on the help page (#3466) * Fix wording in code snippet highlighting section (#3475) * Add a `/` to `paginate_path` in the Pagination documentation (#3479) + * Add a link on all the docs pages to "Improve this page". (#3510) ## 2.5.3 / 2014-12-22 From 7fb71871cf6723b896550a90e0efcda225e4f707 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 24 Feb 2015 23:01:34 -0800 Subject: [PATCH 348/407] Update history to reflect merge of #3485 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 43b296b6f..43cb0ae49 100644 --- a/History.markdown +++ b/History.markdown @@ -63,6 +63,7 @@ * `Site#read_data_file`: read CSV's with proper file encoding (#3455) * Ignore `.jekyll-metadata` in site template (#3496) * Template: Point documentation link to the documentation pages (#3502) + * Removed the trailing slash from the example `/blog` baseurl comment (#3485) ### Development Fixes From 03d21b0cd1eb8111620eebc05cea067541c9bdf6 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 24 Feb 2015 23:02:48 -0800 Subject: [PATCH 349/407] Update history to reflect merge of #3489 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 43cb0ae49..4607b379f 100644 --- a/History.markdown +++ b/History.markdown @@ -118,6 +118,7 @@ * Fix wording in code snippet highlighting section (#3475) * Add a `/` to `paginate_path` in the Pagination documentation (#3479) * Add a link on all the docs pages to "Improve this page". (#3510) + * Add jekyll-auto-image generator to the list of third-party plugins (#3489) ## 2.5.3 / 2014-12-22 From 21fa47f92b36d7ed24151d716f713a6b7bc64258 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 25 Feb 2015 11:57:35 -0800 Subject: [PATCH 350/407] Add benchmark-ips to Gemfile. --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index d695524bb..d5c970c07 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'toml', '~> 0.1.0' gem 'jekyll-paginate', '~> 1.0' gem 'jekyll-gist', '~> 1.0' gem 'jekyll-coffeescript', '~> 1.0' +gem 'jekyll-textile-converter', '~> 0.1.0' gem 'classifier-reborn', '~> 2.0' gem 'rake', '~> 10.1' @@ -32,6 +33,7 @@ gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") if ENV['BENCHMARK'] gem 'rbtrace' gem 'stackprof' + gem 'benchmark-ips' end if ENV['PROOF'] From 4da6bfd81ae1369eb2d1222293a266ab3c3f9369 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 25 Feb 2015 11:57:49 -0800 Subject: [PATCH 351/407] Add benchmark for end_with? vs regexp --- benchmark/end-with-vs-regexp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 benchmark/end-with-vs-regexp diff --git a/benchmark/end-with-vs-regexp b/benchmark/end-with-vs-regexp new file mode 100644 index 000000000..cb849f422 --- /dev/null +++ b/benchmark/end-with-vs-regexp @@ -0,0 +1,13 @@ +require 'benchmark/ips' + +Benchmark.ips do |x| + path_without_ending_slash = '/some/very/very/long/path/to/a/file/i/like' + x.report('no slash regexp') { path_without_ending_slash =~ /\/$/ } + x.report('no slash end_with?') { path_without_ending_slash.end_with?("/") } +end + +Benchmark.ips do |x| + path_with_ending_slash = '/some/very/very/long/path/to/a/file/i/like/' + x.report('slash regexp') { path_with_ending_slash =~ /\/$/ } + x.report('slash end_with?') { path_with_ending_slash.end_with?("/") } +end From 3f3b20399277624b169cc2d1c7e42d015d5cf76e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 25 Feb 2015 11:59:27 -0800 Subject: [PATCH 352/407] Use end_with? instead of regexp for adding index.html --- lib/jekyll/document.rb | 2 +- lib/jekyll/page.rb | 2 +- lib/jekyll/post.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 048dcdbf5..e22e8cf12 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -163,7 +163,7 @@ module Jekyll def destination(base_directory) dest = site.in_dest_dir(base_directory) path = site.in_dest_dir(dest, URL.unescape_path(url)) - path = File.join(path, "index.html") if url =~ /\/$/ + path = File.join(path, "index.html") if url.end_with?("/") path end diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 98f730bfb..2db391412 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -141,7 +141,7 @@ module Jekyll # Returns the destination file path String. def destination(dest) path = site.in_dest_dir(dest, URL.unescape_path(url)) - path = File.join(path, "index.html") if url =~ /\/$/ + path = File.join(path, "index.html") if url.end_with?("/") path end diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index c74522a9f..45b6d0d20 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -279,7 +279,7 @@ module Jekyll def destination(dest) # The url needs to be unescaped in order to preserve the correct filename path = site.in_dest_dir(dest, URL.unescape_path(url)) - path = File.join(path, "index.html") if self.url =~ /\/$/ + path = File.join(path, "index.html") if self.url.end_with?("/") path end From 90c974c4e28a1b05dc498e8377813bae1eb46255 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 25 Feb 2015 16:10:11 -0800 Subject: [PATCH 353/407] Hide the 'Improve this page' message on mobile. /cc #3510 [ci skip] --- site/_layouts/docs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_layouts/docs.html b/site/_layouts/docs.html index 5388a213f..0456c4cc9 100644 --- a/site/_layouts/docs.html +++ b/site/_layouts/docs.html @@ -9,7 +9,7 @@ layout: default
    -
    +

    {{ page.title }}

    From a6217524255a35972160639bcd24a0d8da969fd4 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Wed, 25 Feb 2015 16:09:41 -0800 Subject: [PATCH 354/407] Add Jekyll Talk to Help page on site --- site/help/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/help/index.md b/site/help/index.md index 9a8484665..cdc2ea572 100644 --- a/site/help/index.md +++ b/site/help/index.md @@ -14,6 +14,11 @@ Add **jekyll** to almost any query, and you'll find just what you need. Search through the issues that the fine folks on the **@jekyll/help** team have answered, or ask your own. +### [Jekyll Talk](https://talk.jekyllrb.com/) + +Jekyll Talk is our official Discourse forum. Here, users and contributors +can ask questions and discuss all aspects of Jekyll. + ### [Jekyll on StackOverflow](http://stackoverflow.com/questions/tagged/jekyll) StackOverflow is a staple of any developer's diet. Check out the Jekyll tag From 14fa3287b72473ae2d6bd02952d6204474c751f4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 25 Feb 2015 16:16:16 -0800 Subject: [PATCH 355/407] Update history to reflect merge of #3518 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 4607b379f..1b31a858b 100644 --- a/History.markdown +++ b/History.markdown @@ -86,6 +86,7 @@ ### Site Enhancements + * Add Jekyll Talk to Help page on site (#3518) * Fixing the default host on docs (#3229) * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) * Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186) From 531d0fb261f428accfc0659b1232d9bf3c6ca873 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Thu, 26 Feb 2015 22:12:06 +0100 Subject: [PATCH 356/407] Sort will now raise error on nil object array input. Sort will now throw an error when a nil object array is given as input. See issue #3491 for more information. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/filters.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index d9c84fe88..e71710c9d 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -222,6 +222,9 @@ module Jekyll # # Returns the filtered array of objects def sort(input, property = nil, nils = "first") + if input.nil? + raise ArgumentError.new("Invalid object array given. Object array is null.") + end if property.nil? input.sort else From e56f2414ae065a7fbedf42c9a98bde419d15c530 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Thu, 26 Feb 2015 21:23:21 -0800 Subject: [PATCH 357/407] Add blog post introducing Jekyll Talk --- .../2015-02-26-introducing-jekyll-talk.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 site/_posts/2015-02-26-introducing-jekyll-talk.markdown diff --git a/site/_posts/2015-02-26-introducing-jekyll-talk.markdown b/site/_posts/2015-02-26-introducing-jekyll-talk.markdown new file mode 100644 index 000000000..90863c12e --- /dev/null +++ b/site/_posts/2015-02-26-introducing-jekyll-talk.markdown @@ -0,0 +1,15 @@ +--- +layout: news_item +title: 'Join the Discussion at Jekyll Talk' +date: 2015-02-26 21:06:51 -0800 +author: alfredxing +categories: [community] +--- + +We're super excited to announce the launch of [Jekyll Talk](https://talk.jekyllrb.com), a Discourse forum for anything related to Jekyll! + +The forum was set up by [@envygeeks](https://github.com/envygeeks) to build a community more accessible to Jekyll users and more suitable for general discussion. + +There's already been a lot of interesting topics, including a [site showcase](https://talk.jekyllrb.com/t/showcase-sites-made-using-jekyll/18) and [a poll for Jekyll 3.0 priorities](https://talk.jekyllrb.com/t/poll-installation-priorities-for-3-0/106/9). + +Come join the fun! \ No newline at end of file From ed953e6e1ff11d8251b1bbe89c9356ec717ad546 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 27 Feb 2015 13:07:12 -0800 Subject: [PATCH 358/407] Update history to reflect merge of #3523 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1b31a858b..e290741ee 100644 --- a/History.markdown +++ b/History.markdown @@ -86,6 +86,7 @@ ### Site Enhancements + * Add blog post announcing Jekyll Help (#3523) * Add Jekyll Talk to Help page on site (#3518) * Fixing the default host on docs (#3229) * Add `jekyll-thumbnail-filter` to list of third-party plugins (#2790) From a25f2d7dd680de7e4f0d5406f867f78a0a9f3afa Mon Sep 17 00:00:00 2001 From: Jordon Bedwell Date: Fri, 27 Feb 2015 15:33:08 -0600 Subject: [PATCH 359/407] Ask people to use talk.jekyllrb.com for non bugs. --- CONTRIBUTING.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.markdown b/CONTRIBUTING.markdown index 8bd2febee..2145db65c 100644 --- a/CONTRIBUTING.markdown +++ b/CONTRIBUTING.markdown @@ -4,6 +4,7 @@ Contribute So you've got an awesome idea to throw into Jekyll. Great! Please keep the following in mind: +* **Use https://talk.jekyllrb.com for non-technical or indirect Jekyll questions that are not bugs.** * **Contributions will not be accepted without tests or necessary documentation updates.** * If you're creating a small fix or patch to an existing feature, just a simple test will do. Please stay in the confines of the current test suite and use From cd7b3f54f1617294decc70f0858bcf180db7fba4 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Fri, 27 Feb 2015 22:41:32 -0200 Subject: [PATCH 360/407] Removes the following deprecation warning: 'method adapters is deprecated. use profiles instead' This warning was showing up because the project was using the gem 'simplecov-gem-adapter' which uses the old syntax. * Remove the gem dependency * Add a profile with the same setup that the gem has --- Gemfile | 1 - lib/simplecov_custom_profile.rb | 13 +++++++++++++ test/helper.rb | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 lib/simplecov_custom_profile.rb diff --git a/Gemfile b/Gemfile index d695524bb..f29e4abd2 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 2.0' gem 'launchy', '~> 2.3' gem 'simplecov', '~> 0.9' -gem 'simplecov-gem-adapter', '~> 1.0.1' gem 'mime-types', '~> 1.5' gem 'activesupport', '~> 3.2.13' gem 'jekyll_test_plugin' diff --git a/lib/simplecov_custom_profile.rb b/lib/simplecov_custom_profile.rb new file mode 100644 index 000000000..eebb8fbeb --- /dev/null +++ b/lib/simplecov_custom_profile.rb @@ -0,0 +1,13 @@ +require 'simplecov' + +SimpleCov.profiles.define 'gem' do + add_filter '/test/' + add_filter '/features/' + add_filter '/spec/' + add_filter '/autotest/' + + add_group 'Binaries', '/bin/' + add_group 'Libraries', '/lib/' + add_group 'Extensions', '/ext/' + add_group 'Vendor Libraries', '/vendor/' +end diff --git a/test/helper.rb b/test/helper.rb index 257b2db9c..4efa1f96b 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,5 +1,4 @@ -require 'simplecov' -require 'simplecov-gem-adapter' +require 'simplecov_custom_profile' SimpleCov.start('gem') do add_filter "/vendor/bundle" add_filter "/vendor/gem" From e4b1382bfdfaa5737b5d203dd73d1c7c1eb6666c Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Fri, 27 Feb 2015 23:09:33 -0200 Subject: [PATCH 361/407] Remove unused groups from simplecov's profile --- lib/simplecov_custom_profile.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/simplecov_custom_profile.rb b/lib/simplecov_custom_profile.rb index eebb8fbeb..d7f4914cb 100644 --- a/lib/simplecov_custom_profile.rb +++ b/lib/simplecov_custom_profile.rb @@ -3,11 +3,8 @@ require 'simplecov' SimpleCov.profiles.define 'gem' do add_filter '/test/' add_filter '/features/' - add_filter '/spec/' add_filter '/autotest/' add_group 'Binaries', '/bin/' add_group 'Libraries', '/lib/' - add_group 'Extensions', '/ext/' - add_group 'Vendor Libraries', '/vendor/' end From dae77e9a632a02933937dfaa38ffb871c31753e2 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Fri, 27 Feb 2015 17:31:24 -0800 Subject: [PATCH 362/407] switch remaining textile test files to markdown Textile support was removed from jekyll core in #3319, and most of the tests switched to markdown at that time. This changes the remaining tests to use markdown as well. The vast majority of the test cases were testing things in the file name or front matter, so it doesn't really matter what markup format they use. The one test that was claiming to test that textile was transformed had actually been moved to markdown as well, just not renamed. Fixes #3507 --- ...tile => 2008-02-02-not-published.markdown} | 0 ....textile => 2008-02-02-published.markdown} | 0 ...e => 2008-12-03-permalinked-post.markdown} | 0 ...e => 2009-01-27-array-categories.markdown} | 0 ...textile => 2009-01-27-categories.markdown} | 0 ...y.textile => 2009-01-27-category.markdown} | 0 ...e => 2009-01-27-empty-categories.markdown} | 0 ...ile => 2009-01-27-empty-category.markdown} | 0 ...extile => 2009-01-27-no-category.markdown} | 0 ....textile => 2009-05-18-empty-tag.markdown} | 0 ...textile => 2009-05-18-empty-tags.markdown} | 0 ...18-tag.textile => 2009-05-18-tag.markdown} | 0 ...-tags.textile => 2009-05-18-tags.markdown} | 0 ...textile => 2009-06-22-empty-yaml.markdown} | 0 ...ml.textile => 2009-06-22-no-yaml.markdown} | 0 ...tile => 2010-01-16-override-data.markdown} | 0 ...textile => 2013-01-12-nil-layout.markdown} | 0 ....textile => 2013-01-12-no-layout.markdown} | 0 ...le => 2013-05-10-number-category.markdown} | 0 ...ted.textile => 2008-11-21-nested.markdown} | 0 ....textile => 2008-9-23-categories.markdown} | 0 ...xtile => 2008-12-12-topical-post.markdown} | 0 ....textile => 2008-9-23-categories.markdown} | 0 test/test_excerpt.rb | 2 +- test/test_post.rb | 52 +++++++++---------- 25 files changed, 27 insertions(+), 27 deletions(-) rename test/source/_posts/{2008-02-02-not-published.textile => 2008-02-02-not-published.markdown} (100%) rename test/source/_posts/{2008-02-02-published.textile => 2008-02-02-published.markdown} (100%) rename test/source/_posts/{2008-12-03-permalinked-post.textile => 2008-12-03-permalinked-post.markdown} (100%) rename test/source/_posts/{2009-01-27-array-categories.textile => 2009-01-27-array-categories.markdown} (100%) rename test/source/_posts/{2009-01-27-categories.textile => 2009-01-27-categories.markdown} (100%) rename test/source/_posts/{2009-01-27-category.textile => 2009-01-27-category.markdown} (100%) rename test/source/_posts/{2009-01-27-empty-categories.textile => 2009-01-27-empty-categories.markdown} (100%) rename test/source/_posts/{2009-01-27-empty-category.textile => 2009-01-27-empty-category.markdown} (100%) rename test/source/_posts/{2009-01-27-no-category.textile => 2009-01-27-no-category.markdown} (100%) rename test/source/_posts/{2009-05-18-empty-tag.textile => 2009-05-18-empty-tag.markdown} (100%) rename test/source/_posts/{2009-05-18-empty-tags.textile => 2009-05-18-empty-tags.markdown} (100%) rename test/source/_posts/{2009-05-18-tag.textile => 2009-05-18-tag.markdown} (100%) rename test/source/_posts/{2009-05-18-tags.textile => 2009-05-18-tags.markdown} (100%) rename test/source/_posts/{2009-06-22-empty-yaml.textile => 2009-06-22-empty-yaml.markdown} (100%) rename test/source/_posts/{2009-06-22-no-yaml.textile => 2009-06-22-no-yaml.markdown} (100%) rename test/source/_posts/{2010-01-16-override-data.textile => 2010-01-16-override-data.markdown} (100%) rename test/source/_posts/{2013-01-12-nil-layout.textile => 2013-01-12-nil-layout.markdown} (100%) rename test/source/_posts/{2013-01-12-no-layout.textile => 2013-01-12-no-layout.markdown} (100%) rename test/source/_posts/{2013-05-10-number-category.textile => 2013-05-10-number-category.markdown} (100%) rename test/source/_posts/es/{2008-11-21-nested.textile => 2008-11-21-nested.markdown} (100%) rename test/source/category/_posts/{2008-9-23-categories.textile => 2008-9-23-categories.markdown} (100%) rename test/source/foo/_posts/bar/{2008-12-12-topical-post.textile => 2008-12-12-topical-post.markdown} (100%) rename test/source/z_category/_posts/{2008-9-23-categories.textile => 2008-9-23-categories.markdown} (100%) diff --git a/test/source/_posts/2008-02-02-not-published.textile b/test/source/_posts/2008-02-02-not-published.markdown similarity index 100% rename from test/source/_posts/2008-02-02-not-published.textile rename to test/source/_posts/2008-02-02-not-published.markdown diff --git a/test/source/_posts/2008-02-02-published.textile b/test/source/_posts/2008-02-02-published.markdown similarity index 100% rename from test/source/_posts/2008-02-02-published.textile rename to test/source/_posts/2008-02-02-published.markdown diff --git a/test/source/_posts/2008-12-03-permalinked-post.textile b/test/source/_posts/2008-12-03-permalinked-post.markdown similarity index 100% rename from test/source/_posts/2008-12-03-permalinked-post.textile rename to test/source/_posts/2008-12-03-permalinked-post.markdown diff --git a/test/source/_posts/2009-01-27-array-categories.textile b/test/source/_posts/2009-01-27-array-categories.markdown similarity index 100% rename from test/source/_posts/2009-01-27-array-categories.textile rename to test/source/_posts/2009-01-27-array-categories.markdown diff --git a/test/source/_posts/2009-01-27-categories.textile b/test/source/_posts/2009-01-27-categories.markdown similarity index 100% rename from test/source/_posts/2009-01-27-categories.textile rename to test/source/_posts/2009-01-27-categories.markdown diff --git a/test/source/_posts/2009-01-27-category.textile b/test/source/_posts/2009-01-27-category.markdown similarity index 100% rename from test/source/_posts/2009-01-27-category.textile rename to test/source/_posts/2009-01-27-category.markdown diff --git a/test/source/_posts/2009-01-27-empty-categories.textile b/test/source/_posts/2009-01-27-empty-categories.markdown similarity index 100% rename from test/source/_posts/2009-01-27-empty-categories.textile rename to test/source/_posts/2009-01-27-empty-categories.markdown diff --git a/test/source/_posts/2009-01-27-empty-category.textile b/test/source/_posts/2009-01-27-empty-category.markdown similarity index 100% rename from test/source/_posts/2009-01-27-empty-category.textile rename to test/source/_posts/2009-01-27-empty-category.markdown diff --git a/test/source/_posts/2009-01-27-no-category.textile b/test/source/_posts/2009-01-27-no-category.markdown similarity index 100% rename from test/source/_posts/2009-01-27-no-category.textile rename to test/source/_posts/2009-01-27-no-category.markdown diff --git a/test/source/_posts/2009-05-18-empty-tag.textile b/test/source/_posts/2009-05-18-empty-tag.markdown similarity index 100% rename from test/source/_posts/2009-05-18-empty-tag.textile rename to test/source/_posts/2009-05-18-empty-tag.markdown diff --git a/test/source/_posts/2009-05-18-empty-tags.textile b/test/source/_posts/2009-05-18-empty-tags.markdown similarity index 100% rename from test/source/_posts/2009-05-18-empty-tags.textile rename to test/source/_posts/2009-05-18-empty-tags.markdown diff --git a/test/source/_posts/2009-05-18-tag.textile b/test/source/_posts/2009-05-18-tag.markdown similarity index 100% rename from test/source/_posts/2009-05-18-tag.textile rename to test/source/_posts/2009-05-18-tag.markdown diff --git a/test/source/_posts/2009-05-18-tags.textile b/test/source/_posts/2009-05-18-tags.markdown similarity index 100% rename from test/source/_posts/2009-05-18-tags.textile rename to test/source/_posts/2009-05-18-tags.markdown diff --git a/test/source/_posts/2009-06-22-empty-yaml.textile b/test/source/_posts/2009-06-22-empty-yaml.markdown similarity index 100% rename from test/source/_posts/2009-06-22-empty-yaml.textile rename to test/source/_posts/2009-06-22-empty-yaml.markdown diff --git a/test/source/_posts/2009-06-22-no-yaml.textile b/test/source/_posts/2009-06-22-no-yaml.markdown similarity index 100% rename from test/source/_posts/2009-06-22-no-yaml.textile rename to test/source/_posts/2009-06-22-no-yaml.markdown diff --git a/test/source/_posts/2010-01-16-override-data.textile b/test/source/_posts/2010-01-16-override-data.markdown similarity index 100% rename from test/source/_posts/2010-01-16-override-data.textile rename to test/source/_posts/2010-01-16-override-data.markdown diff --git a/test/source/_posts/2013-01-12-nil-layout.textile b/test/source/_posts/2013-01-12-nil-layout.markdown similarity index 100% rename from test/source/_posts/2013-01-12-nil-layout.textile rename to test/source/_posts/2013-01-12-nil-layout.markdown diff --git a/test/source/_posts/2013-01-12-no-layout.textile b/test/source/_posts/2013-01-12-no-layout.markdown similarity index 100% rename from test/source/_posts/2013-01-12-no-layout.textile rename to test/source/_posts/2013-01-12-no-layout.markdown diff --git a/test/source/_posts/2013-05-10-number-category.textile b/test/source/_posts/2013-05-10-number-category.markdown similarity index 100% rename from test/source/_posts/2013-05-10-number-category.textile rename to test/source/_posts/2013-05-10-number-category.markdown diff --git a/test/source/_posts/es/2008-11-21-nested.textile b/test/source/_posts/es/2008-11-21-nested.markdown similarity index 100% rename from test/source/_posts/es/2008-11-21-nested.textile rename to test/source/_posts/es/2008-11-21-nested.markdown diff --git a/test/source/category/_posts/2008-9-23-categories.textile b/test/source/category/_posts/2008-9-23-categories.markdown similarity index 100% rename from test/source/category/_posts/2008-9-23-categories.textile rename to test/source/category/_posts/2008-9-23-categories.markdown diff --git a/test/source/foo/_posts/bar/2008-12-12-topical-post.textile b/test/source/foo/_posts/bar/2008-12-12-topical-post.markdown similarity index 100% rename from test/source/foo/_posts/bar/2008-12-12-topical-post.textile rename to test/source/foo/_posts/bar/2008-12-12-topical-post.markdown diff --git a/test/source/z_category/_posts/2008-9-23-categories.textile b/test/source/z_category/_posts/2008-9-23-categories.markdown similarity index 100% rename from test/source/z_category/_posts/2008-9-23-categories.textile rename to test/source/z_category/_posts/2008-9-23-categories.markdown diff --git a/test/test_excerpt.rb b/test/test_excerpt.rb index ac4771762..ecd42148f 100644 --- a/test/test_excerpt.rb +++ b/test/test_excerpt.rb @@ -88,7 +88,7 @@ class TestExcerpt < JekyllUnitTest assert_gets_called = false klass.send(:define_method, :assert_gets_called) { assert_gets_called = true } klass.const_set(:EXCERPT_ATTRIBUTES_FOR_LIQUID, Jekyll::Post::EXCERPT_ATTRIBUTES_FOR_LIQUID + ['assert_gets_called']) - post = klass.new(@site, source_dir, '', "2008-02-02-published.textile") + post = klass.new(@site, source_dir, '', "2008-02-02-published.markdown") Jekyll::Excerpt.new(post).to_liquid assert assert_gets_called, 'assert_gets_called did not get called on post.' diff --git a/test/test_post.rb b/test/test_post.rb index ef5b4a46a..20ea65248 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -82,14 +82,14 @@ class TestPost < JekyllUnitTest post = Post.allocate post.categories = ['foo'] post.site = @site - post.process("cat1/2008-09-09-foo-bar.textile") + post.process("cat1/2008-09-09-foo-bar.markdown") assert_equal 1, post.categories.size assert_equal "foo", post.categories[0] post = Post.allocate post.categories = ['foo', 'bar'] post.site = @site - post.process("cat2/CAT3/2008-09-09-foo-bar.textile") + post.process("cat2/CAT3/2008-09-09-foo-bar.markdown") assert_equal 2, post.categories.size assert_equal "foo", post.categories[0] assert_equal "bar", post.categories[1] @@ -104,7 +104,7 @@ class TestPost < JekyllUnitTest should "raise a good error on invalid post date" do assert_raises Jekyll::Errors::FatalException do - @post.process("2009-27-03-foo-bar.textile") + @post.process("2009-27-03-foo-bar.markdown") end end @@ -131,7 +131,7 @@ class TestPost < JekyllUnitTest end should "respect permalink in yaml front matter" do - file = "2008-12-03-permalinked-post.textile" + file = "2008-12-03-permalinked-post.markdown" @post.process(file) @post.read_yaml(@source, file) @@ -230,7 +230,7 @@ class TestPost < JekyllUnitTest context "with specified layout of nil" do setup do - file = '2013-01-12-nil-layout.textile' + file = '2013-01-12-nil-layout.markdown' @post = setup_post(file) @post.process(file) end @@ -369,7 +369,7 @@ class TestPost < JekyllUnitTest assert_equal "# {{ page.title }}\n\nBest **post** ever", @post.content end - should "transform textile" do + should "transform markdown" do @post.process(@real_file) @post.read_yaml(@source, @real_file) assert_equal "

    {{ page.title }}

    \n\n

    Best post ever

    ", @post.transform.strip @@ -461,8 +461,8 @@ class TestPost < JekyllUnitTest setup do clear_dest @site = fixture_site - @site.posts = [setup_post('2008-02-02-published.textile'), - setup_post('2009-01-27-categories.textile')] + @site.posts = [setup_post('2008-02-02-published.markdown'), + setup_post('2009-01-27-categories.markdown')] end should "have next post" do @@ -511,7 +511,7 @@ class TestPost < JekyllUnitTest end should "to_liquid prioritizes post attributes over data" do - post = setup_post("2010-01-16-override-data.textile") + post = setup_post("2010-01-16-override-data.markdown") assert_equal Array, post.tags.class assert_equal Array, post.to_liquid["tags"].class assert_equal Time, post.date.class @@ -523,36 +523,36 @@ class TestPost < JekyllUnitTest assert_gets_called = false klass.send(:define_method, :assert_gets_called) { assert_gets_called = true } klass.const_set(:EXCERPT_ATTRIBUTES_FOR_LIQUID, Jekyll::Post::EXCERPT_ATTRIBUTES_FOR_LIQUID + ['assert_gets_called']) - post = klass.new(@site, source_dir, '', "2008-02-02-published.textile") + post = klass.new(@site, source_dir, '', "2008-02-02-published.markdown") do_render(post) assert assert_gets_called, 'assert_gets_called did not get called on post.' end should "recognize category in yaml" do - post = setup_post("2009-01-27-category.textile") + post = setup_post("2009-01-27-category.markdown") assert post.categories.include?('foo') end should "recognize several categories in yaml" do - post = setup_post("2009-01-27-categories.textile") + post = setup_post("2009-01-27-categories.markdown") assert post.categories.include?('foo') assert post.categories.include?('bar') assert post.categories.include?('baz') end should "recognize empty category in yaml" do - post = setup_post("2009-01-27-empty-category.textile") + post = setup_post("2009-01-27-empty-category.markdown") assert_equal [], post.categories end should "recognize empty categories in yaml" do - post = setup_post("2009-01-27-empty-categories.textile") + post = setup_post("2009-01-27-empty-categories.markdown") assert_equal [], post.categories end should "recognize number category in yaml" do - post = setup_post("2013-05-10-number-category.textile") + post = setup_post("2013-05-10-number-category.markdown") assert post.categories.include?('2013') assert !post.categories.include?(2013) end @@ -564,34 +564,34 @@ class TestPost < JekyllUnitTest end should "recognize tag in yaml" do - post = setup_post("2009-05-18-tag.textile") + post = setup_post("2009-05-18-tag.markdown") assert post.tags.include?('code') end should "recognize tags in yaml" do - post = setup_post("2009-05-18-tags.textile") + post = setup_post("2009-05-18-tags.markdown") assert post.tags.include?('food') assert post.tags.include?('cooking') assert post.tags.include?('pizza') end should "recognize empty tag in yaml" do - post = setup_post("2009-05-18-empty-tag.textile") + post = setup_post("2009-05-18-empty-tag.markdown") assert_equal [], post.tags end should "recognize empty tags in yaml" do - post = setup_post("2009-05-18-empty-tags.textile") + post = setup_post("2009-05-18-empty-tags.markdown") assert_equal [], post.tags end should "allow no yaml" do - post = setup_post("2009-06-22-no-yaml.textile") + post = setup_post("2009-06-22-no-yaml.markdown") assert_equal "No YAML.", post.content end should "allow empty yaml" do - post = setup_post("2009-06-22-empty-yaml.textile") + post = setup_post("2009-06-22-empty-yaml.markdown") assert_equal "Empty YAML.", post.content end @@ -691,7 +691,7 @@ class TestPost < JekyllUnitTest end should "generate categories and topics" do - post = Post.new(@site, File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile') + post = Post.new(@site, File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.markdown') assert_equal ['foo'], post.categories end end @@ -756,12 +756,12 @@ class TestPost < JekyllUnitTest end should "return category if post does not specify category" do - post = setup_post("2009-01-27-no-category.textile") + post = setup_post("2009-01-27-no-category.markdown") assert post.categories.include?('article'), "Expected post.categories to include 'article' but did not." end should "override site category if set on post" do - post = setup_post("2009-01-27-category.textile") + post = setup_post("2009-01-27-category.markdown") assert post.categories.include?('foo'), "Expected post.categories to include 'foo' but did not." assert !post.categories.include?('article'), "Did not expect post.categories to include 'article' but it did." end @@ -779,12 +779,12 @@ class TestPost < JekyllUnitTest end should "return categories if post does not specify categories" do - post = setup_post("2009-01-27-no-category.textile") + post = setup_post("2009-01-27-no-category.markdown") assert post.categories.include?('article'), "Expected post.categories to include 'article' but did not." end should "override site categories if set on post" do - post = setup_post("2009-01-27-categories.textile") + post = setup_post("2009-01-27-categories.markdown") ['foo', 'bar', 'baz'].each do |category| assert post.categories.include?(category), "Expected post.categories to include '#{category}' but did not." end From d79c0fc4dd32b9357a0326706d3cbf15a92c868d Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Sat, 28 Feb 2015 15:10:05 +0100 Subject: [PATCH 363/407] Replaced a picture element link with @parkr's suggestion. Signed-off-by: Martin Jorn Rogalla --- site/_docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index df1f391e3..9f4afb97d 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -566,7 +566,7 @@ You can find a few useful plugins at the following locations: - [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid. - [Youku and Tudou Embed](https://gist.github.com/Yexiaoxing/5891929): Liquid plugin for embedding Youku and Tudou videos. - [Jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (.swf) using [SWFObject](http://code.google.com/p/swfobject/). -- [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [``](http://picture.responsiveimages.org/) element, polyfilled with Scott Jehl’s [Picturefill](https://github.com/scottjehl/picturefill). +- [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [``](https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element) element, polyfilled with Scott Jehl’s [Picturefill](https://github.com/scottjehl/picturefill). - [Jekyll Image Tag](https://github.com/robwierzbowski/jekyll-image-tag): Better images for Jekyll. Save image presets, generate resized images, and add classes, alt text, and other attributes. - [Ditaa Tag](https://github.com/matze/jekyll-ditaa) by [matze](https://github.com/matze): Renders ASCII diagram art into PNG images and inserts a figure tag. - [Jekyll Suggested Tweet](https://github.com/davidensinger/jekyll-suggested-tweet) by [David Ensinger](https://github.com/davidensinger/): A Liquid tag for Jekyll that allows for the embedding of suggested tweets via Twitter’s Web Intents API. From 8e87e9ebece836563a64a57062917f39c8b27017 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 28 Feb 2015 17:28:43 -0800 Subject: [PATCH 364/407] Update history to reflect merge of #3530 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e290741ee..aff4d002c 100644 --- a/History.markdown +++ b/History.markdown @@ -121,6 +121,7 @@ * Add a `/` to `paginate_path` in the Pagination documentation (#3479) * Add a link on all the docs pages to "Improve this page". (#3510) * Add jekyll-auto-image generator to the list of third-party plugins (#3489) + * Replace link to the proposed `picture` element spec (#3530) ## 2.5.3 / 2014-12-22 From 6c073ec476b667202b528158a175f84c218340d7 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 28 Feb 2015 17:29:39 -0800 Subject: [PATCH 365/407] Remove reference to jekyll-textile-converter. --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index d5c970c07..2b39c8f07 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,6 @@ gem 'toml', '~> 0.1.0' gem 'jekyll-paginate', '~> 1.0' gem 'jekyll-gist', '~> 1.0' gem 'jekyll-coffeescript', '~> 1.0' -gem 'jekyll-textile-converter', '~> 0.1.0' gem 'classifier-reborn', '~> 2.0' gem 'rake', '~> 10.1' From 6b09d1818da5a3a2ac388608012d88bdff9df0e8 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 28 Feb 2015 18:56:13 -0800 Subject: [PATCH 366/407] Update history to reflect merge of #3516 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index aff4d002c..ebb0edd8f 100644 --- a/History.markdown +++ b/History.markdown @@ -41,6 +41,7 @@ * Site template: Optimize text rendering for legibility (#3382) * Add `draft?` method to identify if Post is a Draft & expose to Liquid (#3456) * Write regeneration metadata even on full rebuild (#3464) + * Perf: Use `String#end_with?("/")` instead of regexp when checking paths (#3516) ### Bug Fixes From 60f0977a50d191e1ccf336ee4c4a0d434050cc7f Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 28 Feb 2015 21:44:29 -0600 Subject: [PATCH 367/407] Update history to reflect merge of #3528 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index ebb0edd8f..da92f66d8 100644 --- a/History.markdown +++ b/History.markdown @@ -287,6 +287,7 @@ * Allow Travis to 'parallelize' our tests (#2859) * Fix test for Liquid rendering in Sass (#2856) * Fixing "vertycal" typo in site template's `_base.scss` (#2889) + * Convert remaining textile test documents to markdown (#3528) ### Site Enhancements From fbe52bca85b66ad89040ecd1519dc9021ab5a532 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 00:36:20 -0800 Subject: [PATCH 368/407] Move simplecov_custom_profile to test/ & gate with TRAVIS env --- test/helper.rb | 10 ++++++---- {lib => test}/simplecov_custom_profile.rb | 0 2 files changed, 6 insertions(+), 4 deletions(-) rename {lib => test}/simplecov_custom_profile.rb (100%) diff --git a/test/helper.rb b/test/helper.rb index 4efa1f96b..dd6b38daa 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,7 +1,9 @@ -require 'simplecov_custom_profile' -SimpleCov.start('gem') do - add_filter "/vendor/bundle" - add_filter "/vendor/gem" +unless ENV['TRAVIS'] + require File.expand_path('../simplecov_custom_profile', __FILE__) + SimpleCov.start('gem') do + add_filter "/vendor/bundle" + add_filter "/vendor/gem" + end end require 'rubygems' diff --git a/lib/simplecov_custom_profile.rb b/test/simplecov_custom_profile.rb similarity index 100% rename from lib/simplecov_custom_profile.rb rename to test/simplecov_custom_profile.rb From f1edf9e692389f445eabbf45198722758026dd9d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 00:36:40 -0800 Subject: [PATCH 369/407] Add minitest/profile to profile 10 slowest tests --- Gemfile | 1 + script/test | 2 +- test/helper.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f29e4abd2..625cd5f95 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ gem 'jekyll_test_plugin_malicious' gem 'liquid-c', '~> 0.0.3' gem 'minitest' gem 'minitest-reporters' +gem 'minitest-profile' gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") if ENV['BENCHMARK'] diff --git a/script/test b/script/test index 38ae46b63..7da787d59 100755 --- a/script/test +++ b/script/test @@ -20,4 +20,4 @@ fi set -x -time bundle exec ruby -Ilib -Itest -rloader $TEST_FILES +time bundle exec ruby -Ilib -Itest -rloader $TEST_FILES --profile diff --git a/test/helper.rb b/test/helper.rb index dd6b38daa..e4a50db09 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -10,6 +10,7 @@ require 'rubygems' require 'ostruct' require 'minitest/autorun' require 'minitest/reporters' +require 'minitest/profile' require 'jekyll' From 9437bd46699491c31b9bf253db4d2188d45ee653 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 00:37:44 -0800 Subject: [PATCH 370/407] Update history to reflect merge of #3529 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index da92f66d8..7c4d06254 100644 --- a/History.markdown +++ b/History.markdown @@ -84,6 +84,7 @@ * Upgrade tests to use Minitest (#3492) * Remove trailing whitespace (#3497) * Use `fixture_site` for Document tests (#3511) + * Remove adapters deprecation warning (#3529) ### Site Enhancements From 0565308ce67be10530227997cabb58a55fb4f730 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Sun, 1 Mar 2015 09:40:32 +0100 Subject: [PATCH 371/407] Added test to check on nil input for sort filter. - Added a test to check if the sort filter will raise the correct exception on given nil input. - Improved error message and used "nil" consistently. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/filters.rb | 2 +- test/test_filters.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index e71710c9d..ffdc3b732 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -223,7 +223,7 @@ module Jekyll # Returns the filtered array of objects def sort(input, property = nil, nils = "first") if input.nil? - raise ArgumentError.new("Invalid object array given. Object array is null.") + raise ArgumentError.new("Nil object array given. Sort cannot process an empty object array.") end if property.nil? input.sort diff --git a/test/test_filters.rb b/test/test_filters.rb index eec08564f..642a61144 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -280,6 +280,12 @@ class TestFilters < JekyllUnitTest end context "sort filter" do + should "raise Exception when input is nil" do + err = assert_raises ArgumentError do + @filter.sort(nil) + end + assert_equal "Nil object array given. Sort cannot process an empty object array.", err.message + end should "return sorted numbers" do assert_equal [1, 2, 2.2, 3], @filter.sort([3, 2.2, 2, 1]) end From 78af3c5018337368ee113b4b690b2b1c9ae55f2b Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Sun, 1 Mar 2015 09:51:59 +0100 Subject: [PATCH 372/407] Improved clarity of sort nil input error message. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/filters.rb | 2 +- test/test_filters.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index ffdc3b732..5ca87edc7 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -223,7 +223,7 @@ module Jekyll # Returns the filtered array of objects def sort(input, property = nil, nils = "first") if input.nil? - raise ArgumentError.new("Nil object array given. Sort cannot process an empty object array.") + raise ArgumentError.new("Sort: cannot sort a null object.") end if property.nil? input.sort diff --git a/test/test_filters.rb b/test/test_filters.rb index 642a61144..be8ba373f 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -284,7 +284,7 @@ class TestFilters < JekyllUnitTest err = assert_raises ArgumentError do @filter.sort(nil) end - assert_equal "Nil object array given. Sort cannot process an empty object array.", err.message + assert_equal "Sort: cannot sort a null object.", err.message end should "return sorted numbers" do assert_equal [1, 2, 2.2, 3], @filter.sort([3, 2.2, 2, 1]) From 92a9582733dfee0f359e491a8fae236e91087a54 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Sun, 1 Mar 2015 11:16:08 +0100 Subject: [PATCH 373/407] Corrected error message as suggested by @parkr. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/filters.rb | 2 +- test/test_filters.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 5ca87edc7..12d4eb5a5 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -223,7 +223,7 @@ module Jekyll # Returns the filtered array of objects def sort(input, property = nil, nils = "first") if input.nil? - raise ArgumentError.new("Sort: cannot sort a null object.") + raise ArgumentError.new("Cannot sort a null object.") end if property.nil? input.sort diff --git a/test/test_filters.rb b/test/test_filters.rb index be8ba373f..82d319226 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -284,7 +284,7 @@ class TestFilters < JekyllUnitTest err = assert_raises ArgumentError do @filter.sort(nil) end - assert_equal "Sort: cannot sort a null object.", err.message + assert_equal "Cannot sort a null object.", err.message end should "return sorted numbers" do assert_equal [1, 2, 2.2, 3], @filter.sort([3, 2.2, 2, 1]) From c2b613d05e6f7452d2be358624e3c22c2bc9c594 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 16:05:53 -0800 Subject: [PATCH 374/407] Update history to reflect merge of #3469 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 7c4d06254..67e3b5e35 100644 --- a/History.markdown +++ b/History.markdown @@ -124,6 +124,7 @@ * Add a link on all the docs pages to "Improve this page". (#3510) * Add jekyll-auto-image generator to the list of third-party plugins (#3489) * Replace link to the proposed `picture` element spec (#3530) + * Add frontmatter date formatting information (#3469) ## 2.5.3 / 2014-12-22 From 2b1b7b977ba7d55ab894e5125543949b7a58841f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 1 Mar 2015 16:07:29 -0800 Subject: [PATCH 375/407] Upgrade liquid-c to 3.x --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6935f90b8..ef78622c5 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'mime-types', '~> 1.5' gem 'activesupport', '~> 3.2.13' gem 'jekyll_test_plugin' gem 'jekyll_test_plugin_malicious' -gem 'liquid-c', '~> 0.0.3' +gem 'liquid-c', '~> 3.0' gem 'minitest' gem 'minitest-reporters' gem 'minitest-profile' From f251848283789103759d03ed2b359299a2b0a857 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sun, 1 Mar 2015 17:27:56 -0800 Subject: [PATCH 376/407] document 'ordinal' built-in permalink style ordinal was actually added back in April 2013 in ea753130 --- site/_docs/permalinks.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/site/_docs/permalinks.md b/site/_docs/permalinks.md index bf7e9481c..bc9633b9f 100644 --- a/site/_docs/permalinks.md +++ b/site/_docs/permalinks.md @@ -138,6 +138,14 @@ enough to fix it all!

    /:categories/:year/:month/:day/:title/

    + + +

    ordinal

    + + +

    /:categories/:year/:y_day/:title.html

    + +

    none

    From dae5d30096ee09decf024d03531916e187679ddd Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sun, 1 Mar 2015 18:16:49 -0800 Subject: [PATCH 377/407] Update history to reflect merge of #3532 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 67e3b5e35..542d8a162 100644 --- a/History.markdown +++ b/History.markdown @@ -42,6 +42,7 @@ * Add `draft?` method to identify if Post is a Draft & expose to Liquid (#3456) * Write regeneration metadata even on full rebuild (#3464) * Perf: Use `String#end_with?("/")` instead of regexp when checking paths (#3516) + * Docs: document 'ordinal' built-in permalink style (#3532) ### Bug Fixes From 48bf711ec79e4b7131d0332e26eeabb1f5db48e2 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 2 Mar 2015 09:40:05 -0800 Subject: [PATCH 378/407] Update history to reflect merge of #3531 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 542d8a162..683e48d13 100644 --- a/History.markdown +++ b/History.markdown @@ -43,6 +43,7 @@ * Write regeneration metadata even on full rebuild (#3464) * Perf: Use `String#end_with?("/")` instead of regexp when checking paths (#3516) * Docs: document 'ordinal' built-in permalink style (#3532) + * Upgrade liquid-c to 3.x (#3531) ### Bug Fixes From 7a31029c79355795bcd97215000dc4be802f57a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joop=20Au=C3=A9?= Date: Mon, 2 Mar 2015 21:54:05 +0100 Subject: [PATCH 379/407] Removed deprecation inconsistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced occasions where the logger was used to report deprecations. Deprecator is now used instead. Signed-off-by: Joop Aué --- lib/jekyll/commands/doctor.rb | 2 +- lib/jekyll/configuration.rb | 10 +++++----- lib/jekyll/site.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/jekyll/commands/doctor.rb b/lib/jekyll/commands/doctor.rb index 0fab8b3a7..e0ae36a10 100644 --- a/lib/jekyll/commands/doctor.rb +++ b/lib/jekyll/commands/doctor.rb @@ -39,7 +39,7 @@ module Jekyll contains_deprecated_pages = false site.pages.each do |page| if page.uses_relative_permalinks - Jekyll.logger.warn "Deprecation:", "'#{page.path}' uses relative" + + Jekyll::Deprecator.deprecation_message "'#{page.path}' uses relative" + " permalinks which will be deprecated in" + " Jekyll v2.0.0 and beyond." contains_deprecated_pages = true diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index f7f39cb51..e4855a9d7 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -206,7 +206,7 @@ module Jekyll config = clone # Provide backwards-compatibility if config.key?('auto') || config.key?('watch') - Jekyll.logger.warn "Deprecation:", "Auto-regeneration can no longer" + + Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" + " be set from your configuration file(s). Use the"+ " --[no-]watch/-w command-line option instead." config.delete('auto') @@ -214,14 +214,14 @@ module Jekyll end if config.key? 'server' - Jekyll.logger.warn "Deprecation:", "The 'server' configuration option" + + Jekyll::Deprecator.deprecation_message "The 'server' configuration option" + " is no longer accepted. Use the 'jekyll serve'" + " subcommand to serve your site with WEBrick." config.delete('server') end if config.key? 'server_port' - Jekyll.logger.warn "Deprecation:", "The 'server_port' configuration option" + + Jekyll::Deprecator.deprecation_message "The 'server_port' configuration option" + " has been renamed to 'port'. Please update your config" + " file accordingly." # copy but don't overwrite: @@ -230,7 +230,7 @@ module Jekyll end if config.key? 'pygments' - Jekyll.logger.warn "Deprecation:", "The 'pygments' configuration option" + + Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" + " has been renamed to 'highlighter'. Please update your" + " config file accordingly. The allowed values are 'rouge', " + "'pygments' or null." @@ -241,7 +241,7 @@ module Jekyll %w[include exclude].each do |option| if config.fetch(option, []).is_a?(String) - Jekyll.logger.warn "Deprecation:", "The '#{option}' configuration option" + + Jekyll::Deprecator.deprecation_message "The '#{option}' configuration option" + " must now be specified as an array, but you specified" + " a string. For now, we've treated the string you provided" + " as a list of comma-separated values." diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 0e1063c18..aadfb8d0a 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -471,7 +471,7 @@ module Jekyll def relative_permalinks_deprecation_method if config['relative_permalinks'] && has_relative_page? - Jekyll.logger.warn "Deprecation:", "Since v2.0, permalinks for pages" + + Jekyll::Deprecator.deprecation_message "Since v2.0, permalinks for pages" + " in subfolders must be relative to the" + " site source directory, not the parent" + " directory. Check http://jekyllrb.com/docs/upgrading/"+ From 8917ef011cae1ff54a5d7d631113104d5f89a8bb Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Mon, 2 Mar 2015 15:05:37 -0800 Subject: [PATCH 380/407] Update history to reflect merge of #3535 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 683e48d13..308d3ffae 100644 --- a/History.markdown +++ b/History.markdown @@ -44,6 +44,7 @@ * Perf: Use `String#end_with?("/")` instead of regexp when checking paths (#3516) * Docs: document 'ordinal' built-in permalink style (#3532) * Upgrade liquid-c to 3.x (#3531) + * Use consistent syntax for deprecation warning (#3535) ### Bug Fixes From 669c80391278c3ed9b7431eac4c56fedbc50614d Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sat, 21 Feb 2015 19:51:28 -0800 Subject: [PATCH 381/407] always include file extension on destination files This ensures that destination files for HTML posts, pages and collections always include the proper file extension (as defined by output_ext) regardless of permalink structure. This allows for URLs that contain no extension or trailing slash to still result in proper destination files with .html extensions. Because this change relies so heavily on output_ext accurately identifying the extension of the destination file, this change also removes the feature test that tested support for permalinks with a .htm extension. In order to support alternate file extensions, a future patch or plugin will need to modify the output_ext value, at which point everything else should work as expected. --- features/permalinks.feature | 10 ---------- lib/jekyll/document.rb | 6 ++++-- lib/jekyll/page.rb | 1 + lib/jekyll/post.rb | 1 + ...015-02-20-extensionless-permalink.markdown | 7 +++++++ test/source/deal.with.dots.html | 2 +- test/test_document.rb | 17 ++++++++++++++++ test/test_generated_site.rb | 2 +- test/test_page.rb | 16 +++++++++++---- test/test_post.rb | 20 +++++++++++++++++++ 10 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 test/source/_posts/2015-02-20-extensionless-permalink.markdown diff --git a/features/permalinks.feature b/features/permalinks.feature index c4494b4eb..cb90d1f76 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -83,13 +83,3 @@ Feature: Fancy permalinks Then the _site directory should exist And the _site/custom/posts directory should exist And I should see "bla bla" in "_site/custom/posts/some.html" - - Scenario: Use per-post ending in .htm - Given I have a _posts directory - And I have the following post: - | title | date | permalink | content | - | Some post | 2013-04-14 | /custom/posts/some.htm | bla bla | - When I run jekyll build - Then the _site directory should exist - And the _site/custom/posts directory should exist - And I should see "bla bla" in "_site/custom/posts/some.htm" diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index e22e8cf12..cd407dfaa 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -4,7 +4,7 @@ module Jekyll class Document include Comparable - attr_reader :path, :site, :extname + attr_reader :path, :site, :extname, :output_ext attr_accessor :content, :collection, :output YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m @@ -19,6 +19,7 @@ module Jekyll @site = relations[:site] @path = path @extname = File.extname(path) + @output_ext = Jekyll::Renderer.new(site, self).output_ext @collection = relations[:collection] @has_yaml_header = nil end @@ -130,7 +131,7 @@ module Jekyll { collection: collection.label, path: cleaned_relative_path, - output_ext: Jekyll::Renderer.new(site, self).output_ext, + output_ext: output_ext, name: Utils.slugify(basename_without_ext), title: Utils.slugify(data['slug']) || Utils.slugify(basename_without_ext) } @@ -164,6 +165,7 @@ module Jekyll dest = site.in_dest_dir(base_directory) path = site.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if url.end_with?("/") + path << output_ext unless path.end_with?(output_ext) path end diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 2db391412..ca824245b 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -142,6 +142,7 @@ module Jekyll def destination(dest) path = site.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if url.end_with?("/") + path << output_ext unless path.end_with?(output_ext) path end diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 45b6d0d20..780f40f7a 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -280,6 +280,7 @@ module Jekyll # The url needs to be unescaped in order to preserve the correct filename path = site.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if self.url.end_with?("/") + path << output_ext unless path.end_with?(output_ext) path end diff --git a/test/source/_posts/2015-02-20-extensionless-permalink.markdown b/test/source/_posts/2015-02-20-extensionless-permalink.markdown new file mode 100644 index 000000000..f92b21f2f --- /dev/null +++ b/test/source/_posts/2015-02-20-extensionless-permalink.markdown @@ -0,0 +1,7 @@ +--- +layout: ~ +title: Extensionless Permalink +permalink: /:title +--- + +{{ page.url }} diff --git a/test/source/deal.with.dots.html b/test/source/deal.with.dots.html index afe2aa11c..6c87d8062 100644 --- a/test/source/deal.with.dots.html +++ b/test/source/deal.with.dots.html @@ -1,6 +1,6 @@ --- title: Deal with dots -permalink: /deal.with.dots/ +permalink: /deal.with.dots --- Let's test if jekyll deals properly with dots. diff --git a/test/test_document.rb b/test/test_document.rb index b6160bdc4..56d6a6713 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -212,11 +212,16 @@ class TestDocument < JekyllUnitTest }) @site.process @document = @site.collections["slides"].docs[0] + @dest_file = dest_dir("slides/test/example-slide-1.html") end should "produce the right URL" do assert_equal "/slides/test/example-slide-1", @document.url end + + should "produce the right destination" do + assert_equal @dest_file, @document.destination(dest_dir) + end end context "documents in a collection with custom title permalinks" do @@ -238,14 +243,26 @@ class TestDocument < JekyllUnitTest should "produce the right URL if they have a slug" do assert_equal "/slides/so-what-is-jekyll-exactly", @document.url end + should "produce the right destination file if they have a slug" do + dest_file = dest_dir("slides/so-what-is-jekyll-exactly.html") + assert_equal dest_file, @document.destination(dest_dir) + end should "produce the right URL if they don't have a slug" do assert_equal "/slides/example-slide-5", @document_without_slug.url end + should "produce the right destination file if they don't have a slug" do + dest_file = dest_dir("slides/example-slide-5.html") + assert_equal dest_file, @document_without_slug.destination(dest_dir) + end should "produce the right URL if they have a wild slug" do assert_equal "/slides/well-so-what-is-jekyll-then", @document_with_strange_slug.url end + should "produce the right destination file if they have a wild slug" do + dest_file = dest_dir("/slides/well-so-what-is-jekyll-then.html") + assert_equal dest_file, @document_with_strange_slug.destination(dest_dir) + end end context "documents in a collection" do diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index fee492bc3..519b8f3aa 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -14,7 +14,7 @@ class TestGeneratedSite < JekyllUnitTest end should "ensure post count is as expected" do - assert_equal 47, @site.posts.size + assert_equal 48, @site.posts.size end should "insert site.posts into the index" do diff --git a/test/test_page.rb b/test/test_page.rb index 1c8dc215d..9918442fe 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -57,7 +57,11 @@ class TestPage < JekyllUnitTest should "deal properly with dots" do @page = setup_page('deal.with.dots.html') + @dest_file = dest_dir("deal.with.dots.html") + assert_equal "deal.with.dots", @page.basename + assert_equal "/deal.with.dots", @page.url + assert_equal @dest_file, @page.destination(dest_dir) end should "make properties accessible through #[]" do @@ -83,14 +87,18 @@ class TestPage < JekyllUnitTest end end - context "with pretty url style" do + context "with pretty permalink style" do setup do @site.permalink_style = :pretty end - should "return dir correctly" do + should "return dir, url, and destination correctly" do @page = setup_page('contacts.html') + @dest_file = dest_dir("contacts/index.html") + assert_equal '/contacts/', @page.dir + assert_equal '/contacts/', @page.url + assert_equal @dest_file, @page.destination(dest_dir) end should "return dir correctly for index page" do @@ -121,7 +129,7 @@ class TestPage < JekyllUnitTest end end - context "with any other url style" do + context "with any other permalink style" do should "return dir correctly" do @site.permalink_style = nil @page = setup_page('contacts.html') @@ -179,7 +187,7 @@ class TestPage < JekyllUnitTest page.write(dest_dir) assert File.directory?(dest_dir) - assert File.exist?(File.join(dest_dir, '+', 'plus+in+url')) + assert File.exist?(File.join(dest_dir, '+', 'plus+in+url.html')) end should "write even when permalink has '%# +'" do diff --git a/test/test_post.rb b/test/test_post.rb index 20ea65248..2956309fc 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -659,6 +659,26 @@ class TestPost < JekyllUnitTest assert File.exist?(File.join(dest_dir, 'foo-bar', 'index.html')) end + should "write properly with extensionless site permalink" do + post = setup_post("2008-10-18-foo-bar.markdown") + post.site.permalink_style = ":title" + do_render(post) + post.write(dest_dir) + + assert File.directory?(dest_dir) + assert File.exist?(File.join(dest_dir, 'foo-bar.html')) + end + + should "write properly with extensionless post permalink" do + post = setup_post("2015-02-20-extensionless-permalink.markdown") + do_render(post) + post.write(dest_dir) + + assert File.directory?(dest_dir) + assert File.exist?(File.join(dest_dir, 'extensionless-permalink.html')) + assert_equal "

    /extensionless-permalink

    \n", post.content + end + should "insert data" do post = setup_post("2008-11-21-complex.markdown") do_render(post) From d56df7592cb7cb766f26acbd5e9d0d6fb26bac4f Mon Sep 17 00:00:00 2001 From: Philipp Rudloff Date: Tue, 3 Mar 2015 09:52:23 +0100 Subject: [PATCH 382/407] Removing unused code from post layout The post from the site template does not have `meta` in its front matter. Related to #3536. --- lib/site_template/_layouts/post.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/site_template/_layouts/post.html b/lib/site_template/_layouts/post.html index d4f8be3ed..3a0fb52ec 100644 --- a/lib/site_template/_layouts/post.html +++ b/lib/site_template/_layouts/post.html @@ -5,7 +5,7 @@ layout: default

    {{ page.title }}

    - +
    From 5e9b7343bf505319b97eb1094266bb06a58c2589 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Tue, 3 Mar 2015 10:54:13 -0800 Subject: [PATCH 383/407] Update history to reflect merge of #3490 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 308d3ffae..23f81a0e7 100644 --- a/History.markdown +++ b/History.markdown @@ -10,6 +10,7 @@ * Remove most runtime deps (#3323) * Move to Rouge as default highlighter (#3323) * Mimic GitHub Pages `.html` extension stripping behavior in WEBrick (#3452) + * Always include file extension on output files (#3490) ### Minor Enhancements From fa31fcb3bf3e18078fd6f471b67e4ff07a97ddd4 Mon Sep 17 00:00:00 2001 From: Jordon Bedwell Date: Wed, 4 Mar 2015 05:22:29 -0600 Subject: [PATCH 384/407] Update history.md to reflect the merger of #3418 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 23f81a0e7..f4a88eda6 100644 --- a/History.markdown +++ b/History.markdown @@ -46,6 +46,7 @@ * Docs: document 'ordinal' built-in permalink style (#3532) * Upgrade liquid-c to 3.x (#3531) * Use consistent syntax for deprecation warning (#3535) + * Added build --destination and --source flags (#3418) ### Bug Fixes From 2ef9bae75a5aa6d6a0843c1c5582fc047d4ee5df Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Wed, 4 Mar 2015 14:16:55 +0100 Subject: [PATCH 385/407] Refactored url.rb to compliant with Ruby Style Guide. - Single Quotes - Fixed Typo's in variable names. - Removed Redundant Escaping in Regular Expressions. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/url.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 60c965078..4bbbf92e5 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -29,7 +29,7 @@ module Jekyll @permalink = options[:permalink] if (@template || @permalink).nil? - raise ArgumentError, "One of :template or :permalink must be supplied." + raise ArgumentError, 'One of :template or :permalink must be supplied.' end end @@ -44,12 +44,12 @@ module Jekyll # # Returns the _unsanitized String URL def generated_permalink - (@generated_permlink ||= generate_url(@permalink)) if @permalink + (@generated_permalink ||= generate_url(@permalink)) if @permalink end # Generates a URL from the template # - # Returns the _unsanitized String URL + # Returns the unsanitized String URL def generated_url @generated_url ||= generate_url(@template) end @@ -57,7 +57,7 @@ module Jekyll # Internal: Generate the URL by replacing all placeholders with their # respective values in the given template # - # Returns the _unsanitizied_ String URL + # Returns the unsanitized String URL def generate_url(template) @placeholders.inject(template) do |result, token| break result if result.index(':').nil? @@ -81,7 +81,7 @@ module Jekyll .gsub(/\A([^\/])/, '/\1') # Append a trailing slash to the URL if the unsanitized URL had one - url << "/" if in_url[-1].eql?('/') + url << '/' if in_url[-1].eql?('/') url end @@ -107,7 +107,7 @@ module Jekyll # pct-encoded = "%" HEXDIG HEXDIG # sub-delims = "!" / "$" / "&" / "'" / "(" / ")" # / "*" / "+" / "," / ";" / "=" - URI.escape(path, /[^a-zA-Z\d\-._~!$&\'()*+,;=:@\/]/).encode('utf-8') + URI.escape(path, /[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]/).encode('utf-8') end # Unescapes a URL path segment From 0d1586a5c471d322a79177e3e9c2f5813c697c32 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sat, 28 Feb 2015 22:23:08 -0800 Subject: [PATCH 386/407] Improved permalinks for pages and collections This updates the default permalink style for pages and collections to match the site-wide 'permalink' setting. If the permalink setting contains a trailing slash, either explicitly or by being set to ':pretty', then pages and collections permalinks will contain trailing slashes by default as well. Similarly, if the permalink setting contains a trailing ':output_ext', so will pages and collections. If the permalink setting contains neither a trailing slash or extension, neither will pages or collections. This impacts only the default permalink structure for pages and collections. Permalinks set in the frontmatter of an individual page take precedence, as does the permalink setting for a specific collection. Fixes #2691 --- lib/jekyll/collection.rb | 4 ++- lib/jekyll/page.rb | 14 ++++------- lib/jekyll/utils.rb | 40 +++++++++++++++++++++++++++++ test/test_document.rb | 26 ++++++++++++++++++- test/test_page.rb | 54 +++++++++++++++++++++++++++++++++++++++- test/test_utils.rb | 14 +++++++++++ 6 files changed, 140 insertions(+), 12 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index b09a7ed93..e8740cf66 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -170,7 +170,9 @@ module Jekyll # # Returns the URL template to render collection's documents at. def url_template - metadata.fetch('permalink', "/:collection/:path:output_ext") + metadata.fetch('permalink') do + Utils.add_permalink_suffix("/:collection/:path", site.permalink_style) + end end # Extract options for this collection from the site configuration. diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index ca824245b..a4ddb6984 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -63,16 +63,12 @@ module Jekyll # # Returns the template String. def template - if site.permalink_style == :pretty - if index? && html? - "/:path/" - elsif html? - "/:path/:basename/" - else - "/:path/:basename:output_ext" - end - else + if !html? "/:path/:basename:output_ext" + elsif index? + "/:path/" + else + Utils.add_permalink_suffix("/:path/:basename", site.permalink_style) end end diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index bba8b148c..393027906 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -158,5 +158,45 @@ module Jekyll downcase end + # Add an appropriate suffix to template so that it matches the specified + # permalink style. + # + # template - permalink template without trailing slash or file extension + # permalink_style - permalink style, either built-in or custom + # + # The returned permalink template will use the same ending style as + # specified in permalink_style. For example, if permalink_style contains a + # trailing slash (or is :pretty, which indirectly has a trailing slash), + # then so will the returned template. If permalink_style has a trailing + # ":output_ext" (or is :none, :date, or :ordinal) then so will the returned + # template. Otherwise, template will be returned without modification. + # + # Examples: + # add_permalink_suffix("/:basename", :pretty) + # # => "/:basename/" + # + # add_permalink_suffix("/:basename", :date) + # # => "/:basename:output_ext" + # + # add_permalink_suffix("/:basename", "/:year/:month/:title/") + # # => "/:basename/" + # + # add_permalink_suffix("/:basename", "/:year/:month/:title") + # # => "/:basename" + # + # Returns the updated permalink template + def add_permalink_suffix(template, permalink_style) + case permalink_style + when :pretty + template << "/" + when :date, :ordinal, :none + template << ":output_ext" + else + template << "/" if permalink_style.to_s.end_with?("/") + template << ":output_ext" if permalink_style.to_s.end_with?(":output_ext") + end + template + end + end end diff --git a/test/test_document.rb b/test/test_document.rb index 56d6a6713..f8b9db664 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -219,7 +219,31 @@ class TestDocument < JekyllUnitTest assert_equal "/slides/test/example-slide-1", @document.url end - should "produce the right destination" do + should "produce the right destination file" do + assert_equal @dest_file, @document.destination(dest_dir) + end + end + + context "a document in a collection with pretty permalink style" do + setup do + @site = fixture_site({ + "collections" => { + "slides" => { + "output" => true, + } + }, + }) + @site.permalink_style = :pretty + @site.process + @document = @site.collections["slides"].docs[0] + @dest_file = dest_dir("slides/example-slide-1/index.html") + end + + should "produce the right URL" do + assert_equal "/slides/example-slide-1/", @document.url + end + + should "produce the right destination file" do assert_equal @dest_file, @document.destination(dest_dir) end end diff --git a/test/test_page.rb b/test/test_page.rb index 9918442fe..1e4d3da62 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -46,7 +46,7 @@ class TestPage < JekyllUnitTest should "create index url based on filename" do @page = setup_page('/contacts', 'index.html') - assert_equal "/contacts/index.html", @page.url + assert_equal "/contacts/", @page.url end end @@ -129,6 +129,58 @@ class TestPage < JekyllUnitTest end end + context "with date permalink style" do + setup do + @site.permalink_style = :date + end + + should "return url and destination correctly" do + @page = setup_page('contacts.html') + @dest_file = dest_dir("contacts.html") + assert_equal '/contacts.html', @page.url + assert_equal @dest_file, @page.destination(dest_dir) + end + end + + context "with custom permalink style with trailing slash" do + setup do + @site.permalink_style = "/:title/" + end + + should "return url and destination correctly" do + @page = setup_page('contacts.html') + @dest_file = dest_dir("contacts/index.html") + assert_equal '/contacts/', @page.url + assert_equal @dest_file, @page.destination(dest_dir) + end + end + + context "with custom permalink style with file extension" do + setup do + @site.permalink_style = "/:title:output_ext" + end + + should "return url and destination correctly" do + @page = setup_page('contacts.html') + @dest_file = dest_dir("contacts.html") + assert_equal '/contacts.html', @page.url + assert_equal @dest_file, @page.destination(dest_dir) + end + end + + context "with custom permalink style with no extension" do + setup do + @site.permalink_style = "/:title" + end + + should "return url and destination correctly" do + @page = setup_page('contacts.html') + @dest_file = dest_dir("contacts.html") + assert_equal '/contacts', @page.url + assert_equal @dest_file, @page.destination(dest_dir) + end + end + context "with any other permalink style" do should "return dir correctly" do @site.permalink_style = nil diff --git a/test/test_utils.rb b/test/test_utils.rb index ddb63d4bf..9d4a5a4df 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -166,4 +166,18 @@ class TestUtils < JekyllUnitTest end end + context "The \`Utils.add_permalink_suffix\` method" do + should "handle built-in permalink styles" do + assert_equal "/:basename/", Utils.add_permalink_suffix("/:basename", :pretty) + assert_equal "/:basename:output_ext", Utils.add_permalink_suffix("/:basename", :date) + assert_equal "/:basename:output_ext", Utils.add_permalink_suffix("/:basename", :ordinal) + assert_equal "/:basename:output_ext", Utils.add_permalink_suffix("/:basename", :none) + end + + should "handle custom permalink styles" do + assert_equal "/:basename/", Utils.add_permalink_suffix("/:basename", "/:title/") + assert_equal "/:basename:output_ext", Utils.add_permalink_suffix("/:basename", "/:title:output_ext") + assert_equal "/:basename", Utils.add_permalink_suffix("/:basename", "/:title") + end + end end From c1562c8997397cc8ed6e1448767fbfc2bb8b7c63 Mon Sep 17 00:00:00 2001 From: Fabian Tamp Date: Wed, 4 Mar 2015 21:20:08 +0000 Subject: [PATCH 387/407] Improve consistency in site/_docs/plugins.md Three plugin strategies are listed, but then only two were referenced in the following note. I've updated this doc so that all three are referenced. --- site/_docs/plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 9f4afb97d..4958add3a 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -42,12 +42,12 @@ You have 3 options for installing plugins:
    - _plugins and gems + _plugins, _config.yml and Gemfile can be used simultaneously

    - You may use both of the aforementioned plugin options simultaneously in the - same site if you so choose. Use of one does not restrict the use of the other + You may use any of the aforementioned plugin options simultaneously in the + same site if you so choose. Use of one does not restrict the use of the others.

    From ca7375a51b779e754553c4bb5bd98cbf14aca490 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Wed, 4 Mar 2015 22:31:19 +0100 Subject: [PATCH 388/407] Corrected quote-usage. Replaced [-1].eql with end_with. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 4bbbf92e5..14b70631b 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -29,7 +29,7 @@ module Jekyll @permalink = options[:permalink] if (@template || @permalink).nil? - raise ArgumentError, 'One of :template or :permalink must be supplied.' + raise ArgumentError, "One of :template or :permalink must be supplied." end end @@ -81,7 +81,7 @@ module Jekyll .gsub(/\A([^\/])/, '/\1') # Append a trailing slash to the URL if the unsanitized URL had one - url << '/' if in_url[-1].eql?('/') + url << "/" if in_url.end_with?("/") url end From c8d23ffee25f42e844bc31e667ce41416f8ae307 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 4 Mar 2015 15:14:18 -0800 Subject: [PATCH 389/407] Update history to reflect merge of #3544 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index f4a88eda6..29085385a 100644 --- a/History.markdown +++ b/History.markdown @@ -90,6 +90,7 @@ * Remove trailing whitespace (#3497) * Use `fixture_site` for Document tests (#3511) * Remove adapters deprecation warning (#3529) + * Minor fixes to `url.rb` to follow GitHub style guide (#3544) ### Site Enhancements From 252665ddc66c9b85f79875f7171423aff32d41d0 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 4 Mar 2015 15:16:07 -0800 Subject: [PATCH 390/407] Update history to reflect merge of #3546 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 29085385a..dd0e61df8 100644 --- a/History.markdown +++ b/History.markdown @@ -131,6 +131,7 @@ * Add jekyll-auto-image generator to the list of third-party plugins (#3489) * Replace link to the proposed `picture` element spec (#3530) * Add frontmatter date formatting information (#3469) + * Improve consistency and clarity of plugins options note (#3546) ## 2.5.3 / 2014-12-22 From a608494e18cec86637c1d72cbcb5d038b6d18207 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Wed, 4 Mar 2015 15:20:25 -0800 Subject: [PATCH 391/407] Update history to reflect merge of #3538 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index dd0e61df8..fb95cca6d 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ * Move to Rouge as default highlighter (#3323) * Mimic GitHub Pages `.html` extension stripping behavior in WEBrick (#3452) * Always include file extension on output files (#3490) + * Improved permalinks for pages and collections (#3538) ### Minor Enhancements From 117bd8a6f07646c2b7b17b6e79fdb015d77f7e25 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 4 Mar 2015 18:33:22 -0800 Subject: [PATCH 392/407] Update history to reflect merge of #3537 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index fb95cca6d..1808818ba 100644 --- a/History.markdown +++ b/History.markdown @@ -48,6 +48,7 @@ * Upgrade liquid-c to 3.x (#3531) * Use consistent syntax for deprecation warning (#3535) * Added build --destination and --source flags (#3418) + * Site template: remove unused `page.meta` attribute (#3537) ### Bug Fixes From 489da6784a216b1eb1789b618d6aa96f815114b2 Mon Sep 17 00:00:00 2001 From: ChaYoung You Date: Thu, 5 Mar 2015 18:19:32 +0900 Subject: [PATCH 393/407] Remove duplicated range from regex `/\w/` is equivalent to `[a-zA-Z0-9_]`. See http://ruby-doc.org/core-2.2.0/doc/regexp_rdoc.html#label-Character+Classes. --- lib/jekyll/site.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index aadfb8d0a..969102558 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -528,7 +528,7 @@ module Jekyll end def sanitize_filename(name) - name.gsub!(/[^\w\s_-]+/, '') + name.gsub!(/[^\w\s-]+/, '') name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2') name.gsub(/\s+/, '_') end From 7806f9ed52e5f506736f78a5be5757aa87a4dbc5 Mon Sep 17 00:00:00 2001 From: ChaYoung You Date: Thu, 5 Mar 2015 18:21:52 +0900 Subject: [PATCH 394/407] Replace `File.exists?` with `File.exist?` `File.exists?` is deprecated method. See http://ruby-doc.org//core-2.2.0/File.html#exists-3F-method. --- lib/jekyll/configuration.rb | 2 +- test/test_configuration.rb | 6 +++--- test/test_site.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index e4855a9d7..ca5d48390 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -137,7 +137,7 @@ module Jekyll config_files = override.delete('config') if config_files.to_s.empty? default = %w[yml yaml].find(Proc.new { 'yml' }) do |ext| - File.exists? Jekyll.sanitized_path(source(override), "_config.#{ext}") + File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}")) end config_files = Jekyll.sanitized_path(source(override), "_config.#{default}") @default_config_file = true diff --git a/test/test_configuration.rb b/test/test_configuration.rb index 7e14a4189..8de8ac29d 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -42,12 +42,12 @@ class TestConfiguration < JekyllUnitTest assert_equal [source_dir("_config.yml")], @config.config_files(@no_override) end should "return .yaml if it exists but .yml does not" do - mock(File).exists?(source_dir("_config.yml")) { false } - mock(File).exists?(source_dir("_config.yaml")) { true } + mock(File).exist?(source_dir("_config.yml")) { false } + mock(File).exist?(source_dir("_config.yaml")) { true } assert_equal [source_dir("_config.yaml")], @config.config_files(@no_override) end should "return .yml if both .yml and .yaml exist" do - mock(File).exists?(source_dir("_config.yml")) { true } + mock(File).exist?(source_dir("_config.yml")) { true } assert_equal [source_dir("_config.yml")], @config.config_files(@no_override) end should "return the config if given one config file" do diff --git a/test/test_site.rb b/test/test_site.rb index c460d873f..76ce9ce16 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -143,7 +143,7 @@ class TestSite < JekyllUnitTest # simulate destination file deletion File.unlink dest - refute File.exists?(dest) + refute File.exist?(dest) sleep 1 @site.process From 3a4d826852db59b85c1d83d4890f4bfe4b495c4c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 5 Mar 2015 11:20:13 -0800 Subject: [PATCH 395/407] Update history to reflect merge of #3547 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1808818ba..aa414666f 100644 --- a/History.markdown +++ b/History.markdown @@ -93,6 +93,7 @@ * Use `fixture_site` for Document tests (#3511) * Remove adapters deprecation warning (#3529) * Minor fixes to `url.rb` to follow GitHub style guide (#3544) + * Minor changes to resolve deprecation warnings (#3547) ### Site Enhancements From b41ddbb8a92934e9b02ba0b4dd715496a519e59e Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Thu, 5 Mar 2015 14:35:40 -0600 Subject: [PATCH 396/407] Update history to reflect merge of #3520 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index aa414666f..1375f45e0 100644 --- a/History.markdown +++ b/History.markdown @@ -49,6 +49,7 @@ * Use consistent syntax for deprecation warning (#3535) * Added build --destination and --source flags (#3418) * Site template: remove unused `page.meta` attribute (#3537) + * Improve the error message when sorting null objects (#3520) ### Bug Fixes From bb4d47b905a474052cdbd9719750764df14450b0 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 5 Mar 2015 13:14:15 -0800 Subject: [PATCH 397/407] Move History declaration for #3528 back up to HEAD. --- History.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.markdown b/History.markdown index aa414666f..605036932 100644 --- a/History.markdown +++ b/History.markdown @@ -94,6 +94,7 @@ * Remove adapters deprecation warning (#3529) * Minor fixes to `url.rb` to follow GitHub style guide (#3544) * Minor changes to resolve deprecation warnings (#3547) + * Convert remaining textile test documents to markdown (#3528) ### Site Enhancements @@ -299,7 +300,6 @@ * Allow Travis to 'parallelize' our tests (#2859) * Fix test for Liquid rendering in Sass (#2856) * Fixing "vertycal" typo in site template's `_base.scss` (#2889) - * Convert remaining textile test documents to markdown (#3528) ### Site Enhancements From 6d9258bcdcd7537920a87889a69d8ddc003ed6c5 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 5 Mar 2015 13:40:10 -0800 Subject: [PATCH 398/407] Release :gem: v3.0.0.beta2 --- lib/jekyll/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/version.rb b/lib/jekyll/version.rb index 8b67d1cfd..64cdaba2f 100644 --- a/lib/jekyll/version.rb +++ b/lib/jekyll/version.rb @@ -1,3 +1,3 @@ module Jekyll - VERSION = '3.0.0-beta1' + VERSION = '3.0.0.beta2' end From 66785b43ba55d55db77f1e6983324c54013d1f3c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 5 Mar 2015 13:40:18 -0800 Subject: [PATCH 399/407] Release :gem: 3.0.0.beta2 From 013f7edc833cf59af21644f6a1ea799d61f70d86 Mon Sep 17 00:00:00 2001 From: Cory Simmons Date: Fri, 6 Mar 2015 01:17:02 -0500 Subject: [PATCH 400/407] Add permalink warning to pagination docs Fixes https://github.com/jekyll/jekyll-paginate/issues/25 --- site/_docs/pagination.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/site/_docs/pagination.md b/site/_docs/pagination.md index 9352827e9..71403d2af 100644 --- a/site/_docs/pagination.md +++ b/site/_docs/pagination.md @@ -42,6 +42,13 @@ starting with `2`. If a site has 12 posts and specifies `paginate: 5`, Jekyll wi `blog/index.html` with the first 5 posts, `blog/page2/index.html` with the next 5 posts and `blog/page3/index.html` with the last 2 posts into the destination directory. +
    +
    Don't set a permalink
    +

    + Setting a permalink in the front matter of your blog page will cause pagination to break. Just omit the permalink. +

    +
    + ## Liquid Attributes Available The pagination plugin exposes the `paginator` liquid object with the following From 269bcbb7a83af13c48970b2d3d2ca0a58e18ff13 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 6 Mar 2015 16:23:36 -0800 Subject: [PATCH 401/407] Update history to reflect merge of #3551 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 9bcf00f83..f2c462650 100644 --- a/History.markdown +++ b/History.markdown @@ -137,6 +137,7 @@ * Replace link to the proposed `picture` element spec (#3530) * Add frontmatter date formatting information (#3469) * Improve consistency and clarity of plugins options note (#3546) + * Add permalink warning to pagination docs (#3551) ## 2.5.3 / 2014-12-22 From 67ba8ad0cbd851caf82efc7f6290126edece1c3c Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Fri, 6 Mar 2015 19:49:12 -0500 Subject: [PATCH 402/407] Use rspec-mock instead of rr --- Gemfile | 2 +- features/support/env.rb | 1 - test/helper.rb | 16 +++++++++- test/test_command.rb | 4 +-- test/test_configuration.rb | 56 +++++++++++++++++----------------- test/test_entry_filter.rb | 4 +-- test/test_generated_site.rb | 25 +++++---------- test/test_layout_reader.rb | 10 +++--- test/test_log_adapter.rb | 10 +++--- test/test_new_command.rb | 2 +- test/test_path_sanitization.rb | 2 +- test/test_related_posts.rb | 22 ++++--------- test/test_site.rb | 3 +- test/test_tags.rb | 19 ++---------- 14 files changed, 78 insertions(+), 98 deletions(-) diff --git a/Gemfile b/Gemfile index ef78622c5..4299c72e7 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,6 @@ gem 'rake', '~> 10.1' gem 'rdoc', '~> 3.11' gem 'redgreen', '~> 1.2' gem 'shoulda', '~> 3.5' -gem 'rr', '~> 1.1' gem 'cucumber', '1.3.18' gem 'maruku', '~> 0.7.0' gem 'rdiscount', '~> 2.0' @@ -28,6 +27,7 @@ gem 'minitest' gem 'minitest-reporters' gem 'minitest-profile' gem 'test-unit' if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") +gem 'rspec-mocks' if ENV['BENCHMARK'] gem 'rbtrace' diff --git a/features/support/env.rb b/features/support/env.rb index 8f33ff63d..43d74ab91 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,6 +1,5 @@ require 'fileutils' require 'posix-spawn' -require 'rr' require 'minitest/assertions' require 'time' diff --git a/test/helper.rb b/test/helper.rb index e4a50db09..9c5a1eb01 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -11,6 +11,7 @@ require 'ostruct' require 'minitest/autorun' require 'minitest/reporters' require 'minitest/profile' +require 'rspec/mocks' require 'jekyll' @@ -19,7 +20,6 @@ require 'kramdown' require 'redcarpet' require 'shoulda' -require 'rr' include Jekyll @@ -30,6 +30,20 @@ STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:') Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)] class JekyllUnitTest < Minitest::Test + include ::RSpec::Mocks::ExampleMethods + + def before_setup + ::RSpec::Mocks.setup + super + end + + def after_teardown + super + ::RSpec::Mocks.verify + ensure + ::RSpec::Mocks.teardown + end + def fixture_site(overrides = {}) Jekyll::Site.new(site_configuration(overrides)) end diff --git a/test/test_command.rb b/test/test_command.rb index fb9e247bd..f7c3e2378 100644 --- a/test/test_command.rb +++ b/test/test_command.rb @@ -4,7 +4,7 @@ class TestCommand < JekyllUnitTest context "when calling .add_build_options" do should "add common options" do cmd = Object.new - mock(cmd).option.with_any_args.at_least(1) + expect(cmd).to receive(:option).at_least(:once) Command.add_build_options(cmd) end end @@ -12,7 +12,7 @@ class TestCommand < JekyllUnitTest context "when fatal error occurs" do should "exit with non-zero error code" do site = Object.new - stub(site).process { raise Jekyll::Errors::FatalException } + def site.process; raise Jekyll::Errors::FatalException; end error = assert_raises(SystemExit) { Command.process_site(site) } refute_equal 0, error.status end diff --git a/test/test_configuration.rb b/test/test_configuration.rb index 8de8ac29d..ce54223ce 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -42,12 +42,12 @@ class TestConfiguration < JekyllUnitTest assert_equal [source_dir("_config.yml")], @config.config_files(@no_override) end should "return .yaml if it exists but .yml does not" do - mock(File).exist?(source_dir("_config.yml")) { false } - mock(File).exist?(source_dir("_config.yaml")) { true } + allow(File).to receive(:exist?).with(source_dir("_config.yml")).and_return(false) + allow(File).to receive(:exist?).with(source_dir("_config.yaml")).and_return(true) assert_equal [source_dir("_config.yaml")], @config.config_files(@no_override) end should "return .yml if both .yml and .yaml exist" do - mock(File).exist?(source_dir("_config.yml")) { true } + allow(File).to receive(:exist?).with(source_dir("_config.yml")).and_return(true) assert_equal [source_dir("_config.yml")], @config.config_files(@no_override) end should "return the config if given one config file" do @@ -115,27 +115,27 @@ class TestConfiguration < JekyllUnitTest end should "fire warning with no _config.yml" do - mock(SafeYAML).load_file(@path) { raise SystemCallError, "No such file or directory - #{@path}" } - mock($stderr).puts("Configuration file: none".yellow) + allow(SafeYAML).to receive(:load_file).with(@path) { raise SystemCallError, "No such file or directory - #{@path}" } + allow($stderr).to receive(:puts).with("Configuration file: none".yellow) assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({}) end should "load configuration as hash" do - mock(SafeYAML).load_file(@path) { Hash.new } - mock($stdout).puts("Configuration file: #{@path}") + allow(SafeYAML).to receive(:load_file).with(@path).and_return(Hash.new) + allow($stdout).to receive(:puts).with("Configuration file: #{@path}") assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({}) end should "fire warning with bad config" do - mock(SafeYAML).load_file(@path) { Array.new } - mock($stderr).puts(("WARNING: ".rjust(20) + "Error reading configuration. Using defaults (and options).").yellow) - mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow) + allow(SafeYAML).to receive(:load_file).with(@path).and_return(Array.new) + allow($stderr).to receive(:puts).and_return(("WARNING: ".rjust(20) + "Error reading configuration. Using defaults (and options).").yellow) + allow($stderr).to receive(:puts).and_return("Configuration file: (INVALID) #{@path}".yellow) assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({}) end should "fire warning when user-specified config file isn't there" do - mock(SafeYAML).load_file(@user_config) { raise SystemCallError, "No such file or directory - #{@user_config}" } - mock($stderr).puts(("Fatal: ".rjust(20) + "The configuration file '#{@user_config}' could not be found.").red) + allow(SafeYAML).to receive(:load_file).with(@user_config) { raise SystemCallError, "No such file or directory - #{@user_config}" } + allow($stderr).to receive(:puts).with(("Fatal: ".rjust(20) + "The configuration file '#{@user_config}' could not be found.").red) assert_raises LoadError do Jekyll.configuration({'config' => [@user_config]}) end @@ -157,20 +157,20 @@ class TestConfiguration < JekyllUnitTest end should "load default config if no config_file is set" do - mock(SafeYAML).load_file(@paths[:default]) { Hash.new } - mock($stdout).puts("Configuration file: #{@paths[:default]}") + allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return({}) + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({}) end should "load different config if specified" do - mock(SafeYAML).load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} } - mock($stdout).puts("Configuration file: #{@paths[:other]}") + allow(SafeYAML).to receive(:load_file).with(@paths[:other]).and_return({"baseurl" => "http://wahoo.dev"}) + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:other]}") assert_equal Utils.deep_merge_hashes(Jekyll::Configuration::DEFAULTS, { "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => @paths[:other] }) end should "load default config if path passed is empty" do - mock(SafeYAML).load_file(@paths[:default]) { Hash.new } - mock($stdout).puts("Configuration file: #{@paths[:default]}") + allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return({}) + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({ "config" => @paths[:empty] }) end @@ -183,20 +183,20 @@ class TestConfiguration < JekyllUnitTest should "load multiple config files" do External.require_with_graceful_fail('toml') - mock(SafeYAML).load_file(@paths[:default]) { Hash.new } - mock(SafeYAML).load_file(@paths[:other]) { Hash.new } - mock(TOML).load_file(@paths[:toml]) { Hash.new } - mock($stdout).puts("Configuration file: #{@paths[:default]}") - mock($stdout).puts("Configuration file: #{@paths[:other]}") - mock($stdout).puts("Configuration file: #{@paths[:toml]}") + allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return(Hash.new) + allow(SafeYAML).to receive(:load_file).with(@paths[:other]).and_return(Hash.new) + allow(TOML).to receive(:load_file).with(@paths[:toml]).and_return(Hash.new) + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:other]}") + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:toml]}") assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({ "config" => [@paths[:default], @paths[:other], @paths[:toml]] }) end should "load multiple config files and last config should win" do - mock(SafeYAML).load_file(@paths[:default]) { {"baseurl" => "http://example.dev"} } - mock(SafeYAML).load_file(@paths[:other]) { {"baseurl" => "http://wahoo.dev"} } - mock($stdout).puts("Configuration file: #{@paths[:default]}") - mock($stdout).puts("Configuration file: #{@paths[:other]}") + allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return({"baseurl" => "http://example.dev"}) + allow(SafeYAML).to receive(:load_file).with(@paths[:other]).and_return({"baseurl" => "http://wahoo.dev"}) + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") + allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:other]}") assert_equal Utils.deep_merge_hashes(Jekyll::Configuration::DEFAULTS, { "baseurl" => "http://wahoo.dev" }), Jekyll.configuration({ "config" => [@paths[:default], @paths[:other]] }) end end diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb index e3a7e8c02..e5a5dc663 100644 --- a/test/test_entry_filter.rb +++ b/test/test_entry_filter.rb @@ -48,13 +48,13 @@ class TestEntryFilter < JekyllUnitTest should "filter symlink entries when safe mode enabled" do site = Site.new(site_configuration('safe' => true)) - stub(File).symlink?('symlink.js') {true} + allow(File).to receive(:symlink?).with('symlink.js').and_return(true) files = %w[symlink.js] assert_equal [], site.filter_entries(files) end should "not filter symlink entries when safe mode disabled" do - stub(File).symlink?('symlink.js') {true} + allow(File).to receive(:symlink?).with('symlink.js').and_return(true) files = %w[symlink.js] assert_equal files, @site.filter_entries(files) end diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index 519b8f3aa..b3fe811f0 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -4,11 +4,9 @@ class TestGeneratedSite < JekyllUnitTest context "generated sites" do setup do clear_dest - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir}) - end + config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir}) - @site = Site.new(Jekyll.configuration) + @site = fixture_site config @site.process @index = File.read(dest_dir('index.html')) end @@ -59,11 +57,8 @@ OUTPUT context "generating limited posts" do setup do clear_dest - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 5}) - end - - @site = Site.new(Jekyll.configuration) + config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 5}) + @site = fixture_site config @site.process @index = File.read(dest_dir('index.html')) end @@ -75,21 +70,17 @@ OUTPUT should "ensure limit posts is 0 or more" do assert_raises ArgumentError do clear_dest - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => -1}) - end + config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => -1}) - @site = Site.new(Jekyll.configuration) + @site = fixture_site config end end should "acceptable limit post is 0" do clear_dest - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0}) - end + config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0}) - assert Site.new(Jekyll.configuration), "Couldn't create a site with the given limit_posts." + assert Site.new(config), "Couldn't create a site with the given limit_posts." end end end diff --git a/test/test_layout_reader.rb b/test/test_layout_reader.rb index fc2f1fc3f..88f352207 100644 --- a/test/test_layout_reader.rb +++ b/test/test_layout_reader.rb @@ -3,10 +3,8 @@ require 'helper' class TestLayoutReader < JekyllUnitTest context "reading layouts" do setup do - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir}) - end - @site = Site.new(Jekyll.configuration) + config = Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir}) + @site = fixture_site config end should "read layouts" do @@ -22,8 +20,8 @@ class TestLayoutReader < JekyllUnitTest context "when a _layouts directory exists in CWD" do setup do - stub(File).directory? { true } - stub(Dir).pwd { source_dir("blah") } + allow(File).to receive(:directory?).and_return(true) + allow(Dir).to receive(:pwd).and_return(source_dir("blah")) end should "know to use the layout directory relative to CWD" do diff --git a/test/test_log_adapter.rb b/test/test_log_adapter.rb index 99b243bcd..dee5df3ed 100644 --- a/test/test_log_adapter.rb +++ b/test/test_log_adapter.rb @@ -22,7 +22,7 @@ class TestLogAdapter < JekyllUnitTest should "call #debug on writer return true" do writer = LoggerDouble.new logger = Jekyll::LogAdapter.new(writer) - stub(writer).debug('topic '.rjust(20) + 'log message') { true } + allow(writer).to receive(:debug).with('topic '.rjust(20) + 'log message').and_return(true) assert logger.debug('topic', 'log message') end end @@ -31,7 +31,7 @@ class TestLogAdapter < JekyllUnitTest should "call #info on writer return true" do writer = LoggerDouble.new logger = Jekyll::LogAdapter.new(writer) - stub(writer).info('topic '.rjust(20) + 'log message') { true } + allow(writer).to receive(:info).with('topic '.rjust(20) + 'log message').and_return(true) assert logger.info('topic', 'log message') end end @@ -40,7 +40,7 @@ class TestLogAdapter < JekyllUnitTest should "call #warn on writer return true" do writer = LoggerDouble.new logger = Jekyll::LogAdapter.new(writer) - stub(writer).warn('topic '.rjust(20) + 'log message') { true } + allow(writer).to receive(:warn).with('topic '.rjust(20) + 'log message').and_return(true) assert logger.warn('topic', 'log message') end end @@ -49,7 +49,7 @@ class TestLogAdapter < JekyllUnitTest should "call #error on writer return true" do writer = LoggerDouble.new logger = Jekyll::LogAdapter.new(writer) - stub(writer).error('topic '.rjust(20) + 'log message') { true } + allow(writer).to receive(:error).with('topic '.rjust(20) + 'log message').and_return(true) assert logger.error('topic', 'log message') end end @@ -57,7 +57,7 @@ class TestLogAdapter < JekyllUnitTest context "#abort_with" do should "call #error and abort" do logger = Jekyll::LogAdapter.new(LoggerDouble.new) - stub(logger).error('topic', 'log message') { true } + allow(logger).to receive(:error).with('topic', 'log message').and_return(true) assert_raises(SystemExit) { logger.abort_with('topic', 'log message') } end end diff --git a/test/test_new_command.rb b/test/test_new_command.rb index 2e0fd45ce..7321b462a 100644 --- a/test/test_new_command.rb +++ b/test/test_new_command.rb @@ -55,7 +55,7 @@ class TestNewCommand < JekyllUnitTest end stubbed_date = '2013-01-01' - stub.instance_of(Time).strftime { stubbed_date } + allow_any_instance_of(Time).to receive(:strftime) { stubbed_date } erb_template_files.each do |f| f.chomp! '.erb' diff --git a/test/test_path_sanitization.rb b/test/test_path_sanitization.rb index 2a3182e30..b04a2badd 100644 --- a/test/test_path_sanitization.rb +++ b/test/test_path_sanitization.rb @@ -5,7 +5,7 @@ class TestPathSanitization < JekyllUnitTest setup do @source = "C:/Users/xmr/Desktop/mpc-hc.org" @dest = "./_site/" - stub(Dir).pwd { "C:/Users/xmr/Desktop/mpc-hc.org" } + allow(Dir).to receive(:pwd).and_return("C:/Users/xmr/Desktop/mpc-hc.org") end should "strip drive name from path" do assert_equal "C:/Users/xmr/Desktop/mpc-hc.org/_site", Jekyll.sanitized_path(@source, @dest) diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb index 645f2bfbb..42c582793 100644 --- a/test/test_related_posts.rb +++ b/test/test_related_posts.rb @@ -3,11 +3,7 @@ require 'helper' class TestRelatedPosts < JekyllUnitTest context "building related posts without lsi" do setup do - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, - 'destination' => dest_dir}) - end - @site = Site.new(Jekyll.configuration) + @site = fixture_site end should "use the most recent posts for related posts" do @@ -24,23 +20,17 @@ class TestRelatedPosts < JekyllUnitTest context "building related posts with lsi" do setup do - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, - 'destination' => dest_dir, - 'lsi' => true}) - end - any_instance_of(Jekyll::RelatedPosts) { |i| stub(i).display } - @site = Site.new(Jekyll.configuration) + allow_any_instance_of(Jekyll::RelatedPosts).to receive(:display) + @site = fixture_site({"lsi" => true}) end should "use lsi for the related posts" do @site.reset @site.read require 'classifier-reborn' - any_instance_of(::ClassifierReborn::LSI) do |c| - stub(c).find_related { @site.posts[-1..-9] } - stub(c).build_index - end + allow_any_instance_of(::ClassifierReborn::LSI).to receive(:find_related).and_return(@site.posts[-1..-9]) + allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index) + assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build end end diff --git a/test/test_site.rb b/test/test_site.rb index 76ce9ce16..4bc7ddb29 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -162,7 +162,8 @@ class TestSite < JekyllUnitTest end should "sort pages alphabetically" do - stub.proxy(Dir).entries { |entries| entries.reverse } + method = Dir.method(:entries) + allow(Dir).to receive(:entries) { |*args, &block| method.call(*args, &block).reverse } @site.process # files in symlinked directories may appear twice sorted_pages = %w( diff --git a/test/test_tags.rb b/test/test_tags.rb index 4db4ab856..0460f3f6a 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -5,12 +5,7 @@ require 'helper' class TestTags < JekyllUnitTest def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown) - stub(Jekyll).configuration do - site_configuration({ - "highlighter" => "rouge" - }.merge(override)) - end - site = Site.new(Jekyll.configuration) + site = fixture_site({"highlighter" => "rouge"}.merge(override)) if override['read_posts'] site.read_posts('') @@ -645,11 +640,7 @@ CONTENT context "include tag with variable and liquid filters" do setup do - stub(Jekyll).configuration do - site_configuration({'pygments' => true}) - end - - site = Site.new(Jekyll.configuration) + site = fixture_site({'pygments' => true}) post = Post.new(site, source_dir, '', "2013-12-17-include-variable-filters.markdown") layouts = { "default" => Layout.new(site, source_dir('_layouts'), "simple.html")} post.render(layouts, {"site" => {"posts" => []}}) @@ -681,11 +672,7 @@ CONTENT context "relative include tag with variable and liquid filters" do setup do - stub(Jekyll).configuration do - site_configuration({'pygments' => true}) - end - - site = Site.new(Jekyll.configuration) + site = fixture_site('pygments' => true) post = Post.new(site, source_dir, '', "2014-09-02-relative-includes.markdown") layouts = { "default" => Layout.new(site, source_dir('_layouts'), "simple.html")} post.render(layouts, {"site" => {"posts" => []}}) From 0e1050325921dc0419dd2d9b9b18a51e16baaa41 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 6 Mar 2015 18:29:10 -0800 Subject: [PATCH 403/407] Update history to reflect merge of #3552 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index f2c462650..93e601a39 100644 --- a/History.markdown +++ b/History.markdown @@ -96,6 +96,7 @@ * Minor fixes to `url.rb` to follow GitHub style guide (#3544) * Minor changes to resolve deprecation warnings (#3547) * Convert remaining textile test documents to markdown (#3528) + * Migrate the tests to use rspec-mocks (#3552) ### Site Enhancements From 1100ca0782750134d03b552aa8a53f3b9e6b5296 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 7 Mar 2015 17:27:17 -0800 Subject: [PATCH 404/407] Update link to sublime text plugin. --- site/_docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 4958add3a..e70b1d452 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -623,7 +623,7 @@ You can find a few useful plugins at the following locations: #### Editors -- [sublime-jekyll](https://github.com/23maverick23/sublime-jekyll): A Sublime Text package for Jekyll static sites. This package should help creating Jekyll sites and posts easier by providing access to key template tags and filters, as well as common completions and a current date/datetime command (for dating posts). You can install this package manually via GitHub, or via [Package Control](https://sublime.wbond.net/packages/Jekyll). +- [sublime-jekyll](https://github.com/23maverick23/sublime-jekyll): A Sublime Text package for Jekyll static sites. This package should help creating Jekyll sites and posts easier by providing access to key template tags and filters, as well as common completions and a current date/datetime command (for dating posts). You can install this package manually via GitHub, or via [Package Control](https://packagecontrol.io/packages/Jekyll). - [vim-jekyll](https://github.com/parkr/vim-jekyll): A vim plugin to generate new posts and run `jekyll build` all without leaving vim. - [markdown-writer](https://atom.io/packages/markdown-writer): An Atom package for Jekyll. It can create new posts/drafts, manage tags/categories, insert link/images and add many useful key mappings. From 0d96ad21d2f8aff65b2c50aaf50855e6b081a5b7 Mon Sep 17 00:00:00 2001 From: Max Beizer Date: Mon, 9 Mar 2015 13:13:21 -0500 Subject: [PATCH 405/407] Fix grammar on collections docs warning --- site/_docs/collections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/collections.md b/site/_docs/collections.md index fcda98ba8..81d0074bf 100644 --- a/site/_docs/collections.md +++ b/site/_docs/collections.md @@ -7,7 +7,7 @@ permalink: /docs/collections/
    Collections support is unstable and may change

    - This is an experimental feature and that the API may likely change until the feature stabilizes. + This is an experimental feature and the API may change until the feature stabilizes.

    From 007c0593153bd2cf931efefa35470d78d4cfd10b Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 9 Mar 2015 11:38:56 -0700 Subject: [PATCH 406/407] Update history to reflect merge of #3560 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 93e601a39..7d69a616e 100644 --- a/History.markdown +++ b/History.markdown @@ -139,6 +139,7 @@ * Add frontmatter date formatting information (#3469) * Improve consistency and clarity of plugins options note (#3546) * Add permalink warning to pagination docs (#3551) + * Fix grammar in Collections docs API stability warning (#3560) ## 2.5.3 / 2014-12-22 From dac2b17123b71c83aa9f74e4511c234b039e1c3c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 9 Mar 2015 14:15:30 -0700 Subject: [PATCH 407/407] Fix link to @recurser's jekyll plugins. [ci skip] --- site/_docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index e70b1d452..6b62d3fe0 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -589,7 +589,7 @@ You can find a few useful plugins at the following locations: #### Collections -- [Jekyll Plugins by Recursive Design](http://recursive-design.com/projects/jekyll-plugins/): Plugins to generate Project pages from GitHub readmes, a Category page, and a Sitemap generator. +- [Jekyll Plugins by Recursive Design](https://github.com/recurser/jekyll-plugins): Plugins to generate Project pages from GitHub readmes, a Category page, and a Sitemap generator. - [Company website and blog plugins](https://github.com/flatterline/jekyll-plugins) by Flatterline, a [Ruby on Rails development company](http://flatterline.com/): Portfolio/project page generator, team/individual page generator, an author bio liquid tag for use on posts, and a few other smaller plugins. - [Jekyll plugins by Aucor](https://github.com/aucor/jekyll-plugins): Plugins for trimming unwanted newlines/whitespace and sorting pages by weight attribute.