Improve feed.xml.

* add `generator` property
* add image property
* use `xml_escape` instead of `![CDATA]`
* use `date_to_rfc822` instead of the date format string (thanks @troyswanson!)
* fix self reference url
* switch to `isPermaLink` for the `guid`
This commit is contained in:
XhmikosR 2014-04-01 20:13:08 +03:00
parent 781e257298
commit e9a7eff13f
2 changed files with 27 additions and 14 deletions

View File

@ -13,22 +13,35 @@ permalink: /feed.xml
> >
<channel> <channel>
<title xml:lang="en">Jekyll • Simple, blog-aware, static sites</title> <title xml:lang="en">Jekyll • Simple, blog-aware, static sites</title>
<atom:link type="application/atom+xml" href="http://jekyllrb.com/feed/" rel="self"/> <atom:link type="application/atom+xml" href="http://jekyllrb.com/feed.xml" rel="self"/>
<link>http://jekyllrb.com</link> <link>http://jekyllrb.com/</link>
<pubDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate> <pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<lastBuildDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %z" }}</lastBuildDate> <lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
<language>en-US</language> <language>en-US</language>
<generator>Jekyll v{{ jekyll.version }}</generator>
<description>Transform your plain text into static websites and blogs.</description> <description>Transform your plain text into static websites and blogs.</description>
<image>
<description>Transform your plain text into static websites and blogs.</description>
<url>http://jekyllrb.com/img/logo-rss.png</url>
<title>Jekyll • Simple, blog-aware, static sites</title>
<link>http://jekyllrb.com/</link>
<width>144</width>
<height>73</height>
</image>
{% for post in site.posts %} {% for post in site.posts %}
<item> <item>
<title>{{ post.title | xml_escape}}</title> <title>{{ post.title | xml_escape}}</title>
<link>http://jekyllrb.com{{ post.url }}</link> <link>http://jekyllrb.com{{ post.url }}</link>
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate> <pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
<dc:creator>{{ post.author }}</dc:creator> <dc:creator>{{ post.author }}</dc:creator>
{% for tag in post.tags %}<category>{{ tag | xml_escape }}</category> {% for tag in post.tags %}
{% endfor %}{% for cat in post.categories %}<category>{{ cat | xml_escape }}</category> <category>{{ tag | xml_escape }}</category>
{% endfor %}<guid isPermaLink="false">{{ post.id }}</guid> {% endfor %}
<description><![CDATA[ {{ post.content }} ]]></description> {% for cat in post.categories %}
<category>{{ cat | xml_escape }}</category>
{% endfor %}
<guid isPermaLink="true">http://jekyllrb.com{{ post.url }}</guid>
<description>{{ post.content | xml_escape }}</description>
</item> </item>
{% endfor %} {% endfor %}
</channel> </channel>

BIN
site/img/logo-rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB