Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Additionally, the plugin will use the following values, if present in a post's Y

* `description` - A short description of the post.

* `hidden` - When set to true, the post will still be generated by Jekyll, but excluded from the feed, preventing it from appearing in feed readers.

### Author information

*TL;DR: In most cases, put `author: [your name]` in the document's front matter, for sites with multiple authors. If you need something more complicated, read on.*
Expand Down
1 change: 1 addition & 0 deletions lib/jekyll-feed/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
{% unless site.show_drafts %}
{% assign posts = posts | where_exp: "post", "post.draft != true" %}
{% endunless %}
{% assign posts = posts | where_exp: "post", "post.hidden != true" %}
{% assign posts = posts | sort: "date" | reverse %}
{% assign posts_limit = site.feed.posts_limit | default: 10 %}
{% assign cdata_end_token = "]]>" %}
Expand Down
5 changes: 5 additions & 0 deletions spec/fixtures/_posts/2024-01-31-hidden-sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
hidden: true
---

# A hidden post
3 changes: 3 additions & 0 deletions spec/jekyll-feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html"
expect(contents).to_not match "http://example.org/2024/01/31/hidden-sample.html"
end

it "does not include assets or any static files that aren't .html" do
Expand Down Expand Up @@ -431,6 +432,7 @@ def to_s
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html"
expect(contents).to_not match "http://example.org/2024/01/31/hidden-sample.html"
end

it "outputs the category feeds" do
Expand Down Expand Up @@ -463,6 +465,7 @@ def to_s
expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html"
expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html"
expect(contents).to_not match "http://example.org/2016/02/09/a-draft.html"
expect(contents).to_not match "http://example.org/2024/01/31/hidden-sample.html"
end

it "outputs the category feed" do
Expand Down