Skip to content

Instantly share code, notes, and snippets.

@RobinThrift
Created April 11, 2014 21:24
Show Gist options
  • Save RobinThrift/10502785 to your computer and use it in GitHub Desktop.
Save RobinThrift/10502785 to your computer and use it in GitHub Desktop.
Metalsmith RSS feed Handlebars template
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ sitename }}</title>
<description>{{ description }}</description>
<link>{{ baseUrl }}</link>
<atom:link href="{{ baseUrl }}/feed.xml" rel="self" type="application/rss+xml" />
{{#each collections.entries}}
<item>
<title>{{ this.title }}</title>
<description>{{ this.excerpt }}</description>
<pubDate>{{xmldate this.date }}</pubDate>
<link>{{ ../baseUrl }}/{{ this.path }}</link>
<guid isPermaLink="true">{{ ../baseUrl }}/{{ this.path }}</guid>
</item>
{{/each}}
</channel>
</rss>
---
template: feed.hbt
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment