Create RSS for Facebook's Instant Articles

A workaround, but it works:

  1. Create a dummy section:
mkdir content/instantarticles
  1. Add a dummy content file:
touch  content/
  1. Create a layout according to FB’s spec in

This is a sample that can be used to create the template:

<rss version="2.0"
    <title>News Publisher</title>
        Read our awesome news, every day.    
      <title>This is an Instant Article</title>
      <author>Mr. Author</author>
      <description>This is my first Instant Article. How awesome is this?</description>
        (The full content of your article, in HTML form.)

I will add a more complete template when I get there …


I just created my own custom RSS feed for Instant Articles. I ran into an error. After some investigation it turned out that the content:encoded part is not rendered correctly.

The first “<” is rendered as “<” causing the following code to not working.


is rendered as


I found that issue in Hugo 0.15 and 0.17.

Unfortunately, instant articles only seem to work if they are provided as HTML part like described above.

Any ideas? Does anyone has successfully accomplished creating instant articles via RSS feed from Hugo?


@adcgn the little know chomp will take you there! Write it like this for correct CDATA-output:

<content:encoded>{{chomp "<![CDATA[\n"}}{{ .Content | safeHTML }}{{chomp "]]>\n"}}</content:encoded>

You will get an error viewing it directly in the browser, but the source is correctly formatted.

Thanks @Rick, that works quite well and saved me a lot of workarounds.


No worries mate :slight_smile:

Also if you intend to use it for RSS, make sure to validate through W3C’s validator when you are done. Flipboard provides a great guide on how to format RSS