From a89bba37128061a332b71da26bba9c3f24de11a6 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 30 Apr 2018 19:49:16 -0500 Subject: [PATCH 1/6] Fix rendering Liquid constructs in excerpts (#6970) Merge pull request 6970 --- features/post_excerpts.feature | 19 +++++++++++++++++++ lib/jekyll/excerpt.rb | 9 ++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/features/post_excerpts.feature b/features/post_excerpts.feature index 7344000c..6267fdc6 100644 --- a/features/post_excerpts.feature +++ b/features/post_excerpts.feature @@ -34,6 +34,25 @@ Feature: Post excerpts And I should see exactly "

content for entry1.

" in "_site/2007/12/31/entry1.html" And I should see exactly "

content for entry1.

" in "_site/index.html" + Scenario: An excerpt with Liquid constructs from a post with a layout + Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}" + And I have a configuration file with "baseurl" set to "/blog" + And I have a _posts directory + And I have a _layouts directory + And I have a post layout that contains "{{ page.excerpt }}" + And I have the following posts: + | title | date | layout | content | + | entry1 | 2007-12-31 | post | {{ 'assets/style.css' \| relative_url }} | + When I run jekyll build + Then I should get a zero exit status + And the _site directory should exist + And the _site/2007 directory should exist + And the _site/2007/12 directory should exist + And the _site/2007/12/31 directory should exist + And the "_site/2007/12/31/entry1.html" file should exist + And I should see exactly "

/blog/assets/style.css

" in "_site/2007/12/31/entry1.html" + And I should see exactly "

/blog/assets/style.css

" in "_site/index.html" + Scenario: An excerpt from a post with a layout which has context Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}" And I have a _posts directory diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index c711a585..d270624c 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -9,9 +9,12 @@ module Jekyll attr_writer :output def_delegators :@doc, :site, :name, :ext, :extname, - :render_with_liquid?, :collection, :related_posts, + :collection, :related_posts, + :coffeescript_file?, :yaml_file?, :url, :next_doc, :previous_doc + private :coffeescript_file?, :yaml_file? + # Initialize this Excerpt instance. # # doc - The Document. @@ -84,6 +87,10 @@ module Jekyll false end + def render_with_liquid? + !(coffeescript_file? || yaml_file? || !Utils.has_liquid_construct?(content)) + end + protected # Internal: Extract excerpt from the content From 43de0b694f0213604c02510a9fd9cbdd3a4562b3 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 30 Apr 2018 20:49:18 -0400 Subject: [PATCH 2/6] Update history to reflect merge of #6970 [ci skip] --- History.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.markdown b/History.markdown index 4f0c7c1c..c86019d5 100644 --- a/History.markdown +++ b/History.markdown @@ -1,3 +1,9 @@ +## HEAD + +### Bug Fixes + + * Backport #6945 (#6970) + ## 3.8.0 / 2018-04-19 ### Development Fixes From 4a45407558478a46393da4d82928ce090afdcaaa Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 26 Apr 2018 23:27:22 +0530 Subject: [PATCH 3/6] Liquify documents unless published == false --- features/collections.feature | 76 ++++++++++++++++++++++++++++++++++++ lib/jekyll/collection.rb | 9 ++--- 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/features/collections.feature b/features/collections.feature index a8a4e402..33a01ade 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -140,6 +140,44 @@ Feature: Collections And I should see "Newest puppy: Fido" in "_site/index.html" And the "_site/puppies/fido.html" file should exist + Scenario: Access rendered and published collection documents via Liquid + Given I have a _puppies directory + And I have the following documents under the puppies collection: + | title | date | content | published | + | Rover | 2007-12-31 | content for Rover. | true | + | Figor | 2007-12-31 | content for Figor. | false | + | Snowy | 2199-12-31 | content for Snowy. | true | + | Hardy | 2199-12-31 | content for Hardy. | false | + And I have a "_config.yml" file with content: + """ + collections: + puppies: + output: true + """ + And I have a "index.md" page that contains "{% for puppy in site.puppies %}
{{ puppy.title }}
{% endfor %}" + When I run jekyll build + Then I should get a zero exit status + And the _site directory should exist + And I should see "
Rover
" in "_site/index.html" + But I should see "
Snowy
" in "_site/index.html" + And I should not see "
Figor
" in "_site/index.html" + And I should not see "
Hardy
" in "_site/index.html" + And the "_site/puppies/rover.html" file should exist + And the "_site/puppies/figor.html" file should not exist + And the "_site/puppies/snowy.html" file should not exist + And the "_site/puppies/hardy.html" file should not exist + When I run jekyll build --future + Then I should get a zero exit status + And the _site directory should exist + And I should see "
Rover
" in "_site/index.html" + And I should see "
Snowy
" in "_site/index.html" + And I should not see "
Figor
" in "_site/index.html" + But I should not see "
Hardy
" in "_site/index.html" + And the "_site/puppies/rover.html" file should exist + And the "_site/puppies/figor.html" file should not exist + And the "_site/puppies/hardy.html" file should not exist + But the "_site/puppies/snowy.html" file should exist + Scenario: Unrendered collection with future dated document Given I have a _puppies directory And I have the following documents under the puppies collection: @@ -187,6 +225,44 @@ Feature: Collections And I should see "Newest puppy: Fido" in "_site/index.html" And the "_site/puppies/fido.html" file should not exist + Scenario: Access unrendered but publishable collection documents via Liquid + Given I have a _puppies directory + And I have the following documents under the puppies collection: + | title | date | content | published | + | Rover | 2007-12-31 | content for Rover. | true | + | Figor | 2007-12-31 | content for Figor. | false | + | Snowy | 2199-12-31 | content for Snowy. | true | + | Hardy | 2199-12-31 | content for Hardy. | false | + And I have a "_config.yml" file with content: + """ + collections: + puppies: + output: false + """ + And I have a "index.md" page that contains "{% for puppy in site.puppies %}
{{ puppy.title }}
{% endfor %}" + When I run jekyll build + Then I should get a zero exit status + And the _site directory should exist + And I should see "
Rover
" in "_site/index.html" + But I should see "
Snowy
" in "_site/index.html" + And I should not see "
Figor
" in "_site/index.html" + And I should not see "
Hardy
" in "_site/index.html" + And the "_site/puppies/rover.html" file should not exist + And the "_site/puppies/figor.html" file should not exist + And the "_site/puppies/snowy.html" file should not exist + And the "_site/puppies/hardy.html" file should not exist + When I run jekyll build --future + Then I should get a zero exit status + And the _site directory should exist + And I should see "
Rover
" in "_site/index.html" + And I should see "
Snowy
" in "_site/index.html" + And I should not see "
Figor
" in "_site/index.html" + But I should not see "
Hardy
" in "_site/index.html" + And the "_site/puppies/rover.html" file should not exist + And the "_site/puppies/figor.html" file should not exist + And the "_site/puppies/snowy.html" file should not exist + And the "_site/puppies/hardy.html" file should not exist + Scenario: All the documents Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}" And I have fixture collections diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index 2b33a1e6..bdfa4b86 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -210,12 +210,9 @@ module Jekyll private def read_document(full_path) - docs << Document.new(full_path, :site => site, :collection => self).tap do |doc| - doc.read - if !site.publisher.publish?(doc) && site.publisher.hidden_in_the_future?(doc) - Jekyll.logger.debug "Skip Publishing:", "#{doc.relative_path} has a future date" - end - end + doc = Document.new(full_path, :site => site, :collection => self) + doc.read + docs << doc unless doc.data["published"] == false end private From 9ad78ebdeb10870690624e6d435042e2e62d6899 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 1 May 2018 11:04:40 -0400 Subject: [PATCH 4/6] Update history to reflect merge of #6959 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index c86019d5..71e065d4 100644 --- a/History.markdown +++ b/History.markdown @@ -3,6 +3,7 @@ ### Bug Fixes * Backport #6945 (#6970) + * Liquify documents unless published == false (#6959) ## 3.8.0 / 2018-04-19 From 9b8f9bba4e068c03f18db8c97ddf4208a9e08a51 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 26 Apr 2018 01:58:27 -0400 Subject: [PATCH 5/6] Update history to reflect merge of #6945 [ci skip] --- History.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.markdown b/History.markdown index 71e065d4..4b6f7d54 100644 --- a/History.markdown +++ b/History.markdown @@ -2,7 +2,7 @@ ### Bug Fixes - * Backport #6945 (#6970) + * Fix rendering Liquid constructs in excerpts (#6945) * Liquify documents unless published == false (#6959) ## 3.8.0 / 2018-04-19 From 3ed4dbd227221eea600d362297eefc15226d75b9 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Tue, 1 May 2018 11:56:01 -0500 Subject: [PATCH 6/6] Release :gem: 3.8.1 --- History.markdown | 2 +- docs/_config.yml | 2 +- docs/_docs/history.md | 10 ++++++++++ .../2018-05-01-jekyll-3-8-1-released.markdown | 20 +++++++++++++++++++ docs/latest_version.txt | 2 +- lib/jekyll/version.rb | 2 +- 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 docs/_posts/2018-05-01-jekyll-3-8-1-released.markdown diff --git a/History.markdown b/History.markdown index 4b6f7d54..5cef9fef 100644 --- a/History.markdown +++ b/History.markdown @@ -1,4 +1,4 @@ -## HEAD +## 3.8.1 / 2018-05-01 ### Bug Fixes diff --git a/docs/_config.yml b/docs/_config.yml index 2422b6a1..4084cdd6 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,5 +1,5 @@ --- -version: 3.8.0 +version: 3.8.1 name: Jekyll • Simple, blog-aware, static sites description: Transform your plain text into static websites and blogs url: https://jekyllrb.com diff --git a/docs/_docs/history.md b/docs/_docs/history.md index 660125fb..e30472b2 100644 --- a/docs/_docs/history.md +++ b/docs/_docs/history.md @@ -4,6 +4,16 @@ permalink: "/docs/history/" note: This file is autogenerated. Edit /History.markdown instead. --- +## 3.8.1 / 2018-05-01 +{: #v3-8-1} + +### Bug Fixes +{: #bug-fixes-v3-8-1} + +- Fix rendering Liquid constructs in excerpts ([#6945]({{ site.repository }}/issues/6945)) +- Liquify documents unless published == false ([#6959]({{ site.repository }}/issues/6959)) + + ## 3.8.0 / 2018-04-19 {: #v3-8-0} diff --git a/docs/_posts/2018-05-01-jekyll-3-8-1-released.markdown b/docs/_posts/2018-05-01-jekyll-3-8-1-released.markdown new file mode 100644 index 00000000..b750c39d --- /dev/null +++ b/docs/_posts/2018-05-01-jekyll-3-8-1-released.markdown @@ -0,0 +1,20 @@ +--- +title: 'Jekyll 3.8.1 Released' +date: 2018-05-01 11:56:01 -0500 +author: pathawks +version: 3.8.1 +categories: [release] +--- + +Happy May Day :tada: + +The Jekyll team is happy to announce the release of `v3.8.1`, which fixes +a couple of bugs that were introduced two weeks ago in `v3.8.0`. If you have +experienced trouble regarding post excerpts or non-published posts, this release +should be the remedy. Thanks to @Chaosed0 and @domLocalHeroes for originally +reporting these issues, and to @ashmaroli for fixing them so quickly. + +As a reminder, we have started work on Jekyll 4.0. If there are any +features that you would love to see added to Jekyll, or any pain points you +would like to see removed, please do add your ideas to the [Jekyll 4.0 idea +list](https://github.com/jekyll/jekyll/issues/6948). diff --git a/docs/latest_version.txt b/docs/latest_version.txt index 19811903..f2807196 100644 --- a/docs/latest_version.txt +++ b/docs/latest_version.txt @@ -1 +1 @@ -3.8.0 +3.8.1 diff --git a/lib/jekyll/version.rb b/lib/jekyll/version.rb index e1425fe4..f958b6af 100644 --- a/lib/jekyll/version.rb +++ b/lib/jekyll/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Jekyll - VERSION = "3.8.0".freeze + VERSION = "3.8.1".freeze end