Skip to content
Merged
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 @@ -62,6 +62,8 @@ Additionally, the plugin will use the following values, if present in a post's Y

* `author` - The author of the post, e.g., "Dr. Jekyll". If none is given, feed readers will look to the feed author as defined in `_config.yml`. Like the feed author, this can also be an object or a reference to an author in `_data/authors.yml` (see below).

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

### 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
5 changes: 3 additions & 2 deletions lib/jekyll-feed/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
<category term="{{ tag | xml_escape }}" />
{% endfor %}

{% if post.excerpt and post.excerpt != empty %}
<summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
{% assign post_summary = post.description | default: post.excerpt %}
{% if post_summary and post_summary != empty %}
<summary type="html">{{ post_summary | strip_html | normalize_whitespace | xml_escape }}</summary>
{% endif %}

{% assign post_image = post.image.path | default: post.image %}
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/_posts/2014-03-02-march-the-second.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
image: https://cdn.example.org/absolute.png?h=188&w=250
category: news
excerpt: "ignore me"
description: cool post
---

March the second!
5 changes: 5 additions & 0 deletions spec/jekyll-feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
expect(post.summary.content).to eql("Foo")
end

it "includes the item's description" do
post = feed.items[-2]
expect(post.summary.content).to eql("cool post")
end

it "doesn't include the item's excerpt if blank" do
post = feed.items.first
expect(post.summary).to be_nil
Expand Down