Skip to content

Commit a23d3ec

Browse files
authored
Merge branch 'master' into feature/support-all-tags
2 parents a233fee + 6bc0f83 commit a23d3ec

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

History.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## HEAD
2+
3+
## 0.15.1 / 2020-10-04
4+
5+
### Bug Fixes
6+
7+
* MetaTag: when encoding for XML special characters, handle non-string objects (#326)
8+
19
## 0.15.0 / 2020-07-10
210

311
### Minor Enhancements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Jekyll's `smartify` filter uses [kramdown](https://kramdown.gettalong.org/option
134134

135135
### Custom styling
136136

137-
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.
137+
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.
138138

139139
## Why Atom, and not RSS?
140140

lib/jekyll-feed/meta-tag.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ class MetaTag < Liquid::Tag
77

88
def render(context)
99
@context = context
10-
attrs = attributes.map { |k, v| %(#{k}=#{v.encode(:xml => :attr)}) }.join(" ")
11-
"<link #{attrs} />"
10+
attrs = attributes.map do |k, v|
11+
v = v.to_s unless v.respond_to?(:encode)
12+
%(#{k}=#{v.encode(:xml => :attr)})
13+
end
14+
"<link #{attrs.join(" ")} />"
1215
end
1316

1417
private

lib/jekyll-feed/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Jekyll
44
module Feed
5-
VERSION = "0.15.0"
5+
VERSION = "0.15.1"
66
end
77
end

spec/jekyll-feed_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,21 @@
189189
end
190190
end
191191

192+
context "with site.title set as a non-string value" do
193+
class MySiteTitle
194+
def to_s
195+
"My Dynamic Site Title <&>"
196+
end
197+
alias_method :to_liquid, :to_s
198+
end
199+
let(:site_title) { MySiteTitle.new }
200+
let(:overrides) { { "title" => site_title } }
201+
202+
it "ensures the site.title is the string representation of the object" do
203+
expect(feed.title.content).to eql(site_title.to_s.encode(xml: :text))
204+
end
205+
end
206+
192207
context "with site.name set" do
193208
let(:site_name) { "My Site Name" }
194209
let(:overrides) { { "name" => site_name } }

0 commit comments

Comments
 (0)