Skip to content

Instantly share code, notes, and snippets.

@thesowah
Created June 24, 2014 13:40
Show Gist options
  • Save thesowah/95d9596405316f9885b4 to your computer and use it in GitHub Desktop.
Save thesowah/95d9596405316f9885b4 to your computer and use it in GitHub Desktop.
Jekyll Template for Atom, RSS feed. Template leaves HTML entities like — intact in XML + XSLT
---
layout: nil
title : Atom Feed
---
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY mdash "&#x2014;">]>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{site.name}}</title>
<link type="application/atom+xml" href="{{site.url}}/feed.xml" rel="self"/>
<link type="text/html" href="{{site.url}}" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{site.url}}/all_feed</id>
<author>
<name>{{site.owner.name}}</name>
</author>
{% for post in site.posts limit:20 %}
<entry>
<title>{{ post.title }}</title>
<link href="{{site.url}}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{site.url}}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment