Skip to content

Commit

Permalink
Merge branch 'master' into feature/support-all-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
somini committed Nov 1, 2020
2 parents a233fee + 6bc0f83 commit a23d3ec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
8 changes: 8 additions & 0 deletions History.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## HEAD

## 0.15.1 / 2020-10-04

### Bug Fixes

* MetaTag: when encoding for XML special characters, handle non-string objects (#326)

## 0.15.0 / 2020-07-10

### Minor Enhancements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Jekyll's `smartify` filter uses [kramdown](https://kramdown.gettalong.org/option

### Custom styling

Want to style what your feed looks like in the browser? Simply add an XSLT at `/feed.xslt.xml` and Jekyll Feed will link to the stylesheet.
Want to style what your feed looks like in the browser? When a XSLT Styleheet file named `feed.xslt.xml` exists at the root of your repository, a link to this stylesheet is added to the generated feed.

## Why Atom, and not RSS?

Expand Down
7 changes: 5 additions & 2 deletions lib/jekyll-feed/meta-tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ class MetaTag < Liquid::Tag

def render(context)
@context = context
attrs = attributes.map { |k, v| %(#{k}=#{v.encode(:xml => :attr)}) }.join(" ")
"<link #{attrs} />"
attrs = attributes.map do |k, v|
v = v.to_s unless v.respond_to?(:encode)
%(#{k}=#{v.encode(:xml => :attr)})
end
"<link #{attrs.join(" ")} />"
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-feed/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Jekyll
module Feed
VERSION = "0.15.0"
VERSION = "0.15.1"
end
end
15 changes: 15 additions & 0 deletions spec/jekyll-feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,21 @@
end
end

context "with site.title set as a non-string value" do
class MySiteTitle
def to_s
"My Dynamic Site Title <&>"
end
alias_method :to_liquid, :to_s
end
let(:site_title) { MySiteTitle.new }
let(:overrides) { { "title" => site_title } }

it "ensures the site.title is the string representation of the object" do
expect(feed.title.content).to eql(site_title.to_s.encode(xml: :text))
end
end

context "with site.name set" do
let(:site_name) { "My Site Name" }
let(:overrides) { { "name" => site_name } }
Expand Down

0 comments on commit a23d3ec

Please sign in to comment.