Your sites Log in Sign up Menu

Custom meta in feed.rss?

I've added custom meta to feed.rss without an issue before, but my recent attempt isn't working quite right.

{{#metadata}}
<figure>
    <figcaption>Listen:</figcaption>
    <audio controls src="{{audio}}"></audio>
    <a href="{{audio}}">Download audio</a>
</figure>
{{/metadata}}

Where {{audio}} = the MP3's URL. The audio player is showing in the feed even when posts do not have {{audio}} custom meta data. Any suggestions?


2 months ago, 1 replies   developers   metadata   Improve this question

You'll want to do this instead:

{{#metadata.audio}}
<figure>
    <figcaption>Listen:</figcaption>
    <audio controls src="{{{metadata.audio}}}"></audio>
    <a href="{{{metadata.audio}}}">Download audio</a>
</figure>
{{/metadata.audio}}

The {{metadata}} object is always present, the {{metadata.audio}} property is only present when you set custom Audio metadata in your post.

Answered 2 months ago · Improve this answer