diff --git a/History.markdown b/History.markdown index 919afa8a..2259e08e 100644 --- a/History.markdown +++ b/History.markdown @@ -14,6 +14,10 @@ * Icon and logo support with simple tests (#412) +### Bug Fixes + + * Include the tag name in the title of per-tag feeds, matching category feeds (#406) + ## 0.17.0 / 2022-10-14 ### Documentation diff --git a/lib/jekyll-feed/feed.xml b/lib/jekyll-feed/feed.xml index dfc0bfff..4b5df418 100644 --- a/lib/jekyll-feed/feed.xml +++ b/lib/jekyll-feed/feed.xml @@ -18,6 +18,10 @@ {% assign category = page.category | capitalize %} {% assign title = title | append: " | " | append: category %} {% endif %} + {% if page.tags %} + {% assign tag = page.tags | capitalize %} + {% assign title = title | append: " | " | append: tag %} + {% endif %} {% if title %} {{ title | smartify | xml_escape }} diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index 6f5d58d0..33ee73ac 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -582,6 +582,8 @@ def to_s expect(Pathname.new(dest_dir("feed/by_tag/fail.xml"))).to exist expect(Pathname.new(dest_dir("feed/by_tag/success.xml"))).to exist + expect(tags_feed_test).to match 'My awesome site | Test' + expect(tags_feed_test).to match "/2013/12/12/dec-the-second.html" expect(tags_feed_test).to match "/2014/03/04/march-the-fourth.html" expect(tags_feed_test).to match "/2015/01/18/jekyll-last-modified-at.html"