Skip to content

Instantly share code, notes, and snippets.

@sleepdeprecation
Created April 16, 2012 03:42
Show Gist options
  • Save sleepdeprecation/2396248 to your computer and use it in GitHub Desktop.
Save sleepdeprecation/2396248 to your computer and use it in GitHub Desktop.
mynt RSS Feed

This is a fairly simple rss feed for mynt.

It will output your last twenty posts, to change that, just change the line {% for post in posts[0:20] %}, making twenty however many you want (if you want all, get rid of [0:20] completely.

The timezone is hard coded to GMT-0600, Central Standard Time, change that as wanted.

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.title }}</description>
<link>{{ site.base_url }}</link>
<language>en-us</language>
<pubDate>{{ posts[0].timestamp|date('%a, %d %b %Y %H:%M:%S -0600') }}</pubDate>
<lastBuildDate>{{ none|date('%a, %d %b %Y %H:%M:%S -0600') }}</lastBuildDate>
{% for post in posts[0:20] %}
<item>
<title>{{ post.title }}</title>
<link>{{ post.url }}</link>
<guid>{{ post.url }}</guid>
<pubDate>{{ post.timestamp|date('%a, %d %b %Y %H:%M:%S -0600') }}</pubDate>
<author> [YOUR NAME] </author>
<description>{{ post.content }}</description>
</item>
{% endfor %}
</channel>
</rss>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment