Feature images in custom RSS feed

hi! I’m trying to create a custom RSS feed for my Ghost blog, which I need to be used by a news aggregator. The problem with the default RSS feed is that this aggregator somehow can’t see my feature images as well as feature images captions. Their suport say that in order to do this I have to add figure tag to the feature image and figcaption to the caption.
Is there a way how can I do it with handlebars?
I tried several ways to modify:
<media:content url="{{feature_image}}" medium=“image”/>
content:encoded</content:encoded>
but still no result.
Any ideas?
Thanks in advance.

I used {{img_url feature_image}} for a custom Google news feed. Give that a try.

unfortunately, didn’t work

Sorry is it the caption you would like displayed within the feed?

If so, try:

<media:content url="{{feature_image}}" medium="image"/>
<media:description>{{feature_image_caption}}</media:description>

didn’t work either :frowning:

Interesting, it works for us - if you look at media:description that is pulling the image caption using:

{{feature_image_caption}}

0512a537c970782d41c938aad3ac1173

i can’t even make my feature image visible. now when I validate my feed I see this (meaning no image):
Снимок экрана 2021-07-22 в 15.33.03

Share a snippet of your feed here.

<?xml version = "1.0" encoding = "UTF-8"?>
<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[ {{@site.title}} ]]></title>
<description><![CDATA[ {{@site.description}} ]]></description>
<link>{{@site.url}}</link>
<language>ru</language>
<image>
    <url>{{@site.url}}/favicon.png</url>
    <title>{{@site.title}}</title>
    <link>{{@site.url}}</link>
</image>
<lastBuildDate>{{date format="ddd, DD MMM YYYY HH:mm:ss ZZ"}}</lastBuildDate>
<atom:link href="{{@site.url}}" rel="self" type="application/rss+xml"/>
<ttl>60</ttl>

{{#get "posts" limit="all" include="authors,tags"}}
    {{#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.name}} ]]></category>
        <dc:creator><![CDATA[ {{primary_author.name}} ]]></dc:creator>
        <pubDate>{{date format="ddd, DD MMM YYYY HH:mm:ss ZZ"}}</pubDate>
        <media:content url="{{feature_image}}" medium="image"/>
        <media:description>{{feature_image_caption}}</media:description>
        <content:encoded><![CDATA[ {{content}} ]]></content:encoded>
    </item>
    {{/foreach}}
{{/get}}

</channel>
</rss>

http://pastie.org/p/60tygm5ozlzcud6QeLWZdN

What about the output of the feed?

Just bare in mind that image caption was recently introduced. What version of Ghost are you running?

I’m using the latest version of Ghost (at ghost.org)
that’s the output I got: https://www.baltwave.com/news/rss/

Yes, the output is displaying the image path without your domain.

As a quick fix, you could add

<media:content url="{{@site.url}}{{feature_image}}" medium="image"/>

tried that, but still no images :frowning:

<media:content url="{{@site.url}}{{feature_image}}" medium="image"/>

That should work or just hardcode your URL

<media:content url="https://mysite.com{{feature_image}}" medium="image"/>

But you shouldn’t really need to do this.

whatever I do, still no result :frowning: maybe there is a way how I can use this
media:content url="{{@site.url}}{{feature_image}}"
inside content:encoded section?

I can see the full image path on your feed now.

that’s because I’m using

<media:content url="https://mysite.com{{img_url feature_image}}" medium="image"/>

is that correct? but actually before I tried

<media:content url="https://mysite.com{{feature_image}}" medium="image"/>

and still no result

This is what we use and it works perfectly of us:

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

Notice we also have words=“100” on the content tag as we are limiting the number of words that appear on the feed.

may I look at the output of your feed?