Skip to content

Instantly share code, notes, and snippets.

@richardsongo
Last active August 29, 2015 14:28
Show Gist options
  • Save richardsongo/adf1831cded19395ced4 to your computer and use it in GitHub Desktop.
Save richardsongo/adf1831cded19395ced4 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ siteName }}</title>
<link>{{ siteUrl }}</link>
<atom:link href="{{ craft.request.url }}" rel="self" type="application/rss+xml" />
<description><![CDATA[ {{ siteInfo.siteDescription }} ]]> </description>
<language>fr</language>
<pubDate>{{ now.rss }}</pubDate>
<lastBuildDate>{{ now.rss }}</lastBuildDate>
{% set entries = craft.entries({ section: 'news' }) %}
{% for entry in entries %}
{% set image = entry.featuredImage.first() %}
{% set entryCategory = entry.categories.first() %}
<item>
<title>{{ entry.title }}</title>
<link>{{ entry.url }}</link>
<pubDate>{{ entry.postDate.rss }}</pubDate>
<author> {{ entry.author.fullName }}</author>
<guid>{{ entry.url }}</guid>
<category domain="{{ entryCategory.url }}">{{ entryCategory }}</category>
<enclosure length="{{ image.size }}" url="{{ image.url }}" type="image/jpeg" />
<media:thumbnail url="{{ image.url }}" width="{{ image.width }}" height="{{ image.height }}" />
<description><![CDATA[
{{ entry.body }}
]]></description>
</item>
{% endfor %}
</channel>
</rss>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment