Create an Atom Feed

johnmuhl edited this page Aug 24, 2010 · 5 revisions
Clone this wiki locally

Create a new layout called Atom Feed click the More link and enter application/atom+xml for the context-type area. In the body enter:


Create a new page called “News Feed”, click the More link and set the slug to news.atom in the body part enter:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="" xml:lang="en-us">
  <title type="text"><r:title/></title>
    <r:find url="/blog">
      <r:children:each limit="1" order="desc">
        <r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/>
    <name>Your Name</name>
  <link rel="self" type="application/atom+xml" href="<r:url/>"/>
  <link rel="alternate" type="text/html" href=""/>
  <generator>Radiant CMS</generator>
  <r:find url="/blog">
    <r:children:each order="desc">
      <r:unless_content part="ignore">
          <title type="html"><r:escape_html><r:title/></r:escape_html></title>
          <updated><r:date for="updated_at" format="%Y-%m-%dT%H:%M:%SZ"/></updated>
          <content type="html"><r:escape_html><r:content/></r:escape_html></content>
          <link rel="alternate" type="text/html" href="<r:slug/>/"/>
          <r:if_content part="extended">
            <summary><r:content part="extended"/></summary>
          <published><r:date for="published_at" format="%Y-%m-%dT%H:%M:%SZ"/></published>

Adjust where necessary. Add a page part called ignore, set the layout to Atom Feed.

Now wherever you have the HTML <head> of your site, add:

<link href="/news.atom" rel="alternate" title="News Feed" type="application/atom+xml">