I'm trying to create an RSS feed using Statamic. I followed these instructions which essentially are the same instructions as creating a normal page:

  1. Layout: site/themes/[theme]/layouts/feed-layout.html, which is blank other than {{ template_content }}.
  2. Template: site/themes/[theme]/templates/feed-template.html, which contains the XML feed markup (...)
  3. Content: site/content/feed.md, which contains yaml frontmatter setting layout: feed-layout and template: feed-template
  4. Route: added a route, which looks like this:
/feed:
    layout: feed-layout
    template: feed-template

When I go to http://[example.com]/feed, I indeed get the content I'm looking for, but it's rendering as HTML (like, the page source is wrapped in <html> tags).

Here's some other stuff I tried, which each just returned 404s:

  • Route as /feed and visiting /feed.xml
  • Route as /feed.xml and visiting /feed.xml
  • Change the feed-layout extension to .xml

Any other ideas how to go about this? I found several articles and forum posts when searching Google for statamic rss, but none of them mention routes or how to render a page as XML instead of HTML.