Custom RSS "author.name" attribute not working

Hi all!

I’m having an issue creating a custom RSS feed. The current issue is that the author.name attribute is not appearing in my feed. This is a required field for our syndication partners and I can’t seem to figure out what is going on.

I thought the issue was with my syntax but even using the exact example RSS that is given in Ghost Documentation, it leaves the author tag blank (creator):

You can see that in this screenshot here:

For the record, the example actually leaves out the include=“authors” addition to the #get “posts” request but either with or without it doesn’t make a difference here.

RSS Link: https://motorious.ghost.io/rss/msn/
Here is the rss file that is in the currently active theme:

    <rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
    <title><![CDATA[ {{@blog.title}} ]]></title>
    <description><![CDATA[ {{@blog.description}} ]]></description>
    <link>{{@blog.url}}</link>
    <image>
        <url>{{@blog.url}}/favicon.png</url>
        <title>{{@blog.title}}</title>
        <link>{{@blog.url}}</link>
    </image>
    <lastBuildDate>{{date format="ddd, DD MMM YYYY HH:mm:ss ZZ"}}</lastBuildDate>
    <atom:link href="{{@blog.url}}" rel="self" type="application/rss+xml"/>
    <ttl>60</ttl>

    {{#get "posts" limit="all"}}
        {{#foreach posts}}
        <item>
            <title><![CDATA[ {{title}} ]]></title>
            <description><![CDATA[ {{excerpt}} ]]></description>
            <link>{{url absolute="true"}}</link>
            <guid isPermaLink="false">{{id}}</guid>
            <category><![CDATA[ {{primary_tag}} ]]></category>
            <dc:creator><![CDATA[ {{author.name}} ]]></dc:creator>
            <pubDate>{{date format="ddd, DD MMM YYYY HH:mm:ss ZZ"}}</pubDate>
            <media:content url="{{feature_image}}" medium="image"/>
            <content:encoded><![CDATA[ {{content}} ]]></content:encoded>
        </item>
        {{/foreach}}
    {{/get}}

    </channel>
    </rss>

Thanks in advance for any help!

Talked to Ghost support was able to resolve. To leave reference for others:

It appears the Custom RSS Guide needs a small update to address two items that do not currently work out of the box if you start with the example rss.hbs code on that page:

  1. Include the include=“authors” part in the #get

  2. The syntax change from “author.name” to “primary_author.name” in the creator line.

2 Likes

Thanks for sharing this @Eric_Morgan. I’ve updated the custom RSS integration page with the template chanages.

2 Likes

Thanks @DavidDarnes!

1 Like