Log in Sign up

RSS defined by YAML front matter?

I have been trying various ways to have an rss feed defined by a YAML category holding the information about the language in which the post is written.

Is there a way to achieve this? I got it to work with tags but would prefer that category not to show as a tag.

Any pointers will be much appreciated.


5 days ago, 4 replies   rss   developers   Edit question

Can you share how you are defining your category in YAML? Is it something like this?

---
language: js
---
Answered 8 days ago · Edit answer

It would look like your example but instead of 'js' would say 'english'.

Answered 7 days ago · Edit answer

I see – would you be willing to restructure your metadata? e.g. in one post:

---
english: yes

or in another post:

---
spanish: yes

This way, you can take advantage of the existence of the key to generate an RSS feed for posts with english metadata, e.g. /english.rss:

...
{{#allEntries}}
    {{#metadata.english}}
  <item> 
    <title><![CDATA[ {{{title}}} ]]></title>
    ...
  </item>
    {{/metadata.english}}
  {{/allEntries}}
...

You'd use the /feed.rss file as a base, replacing {{#recentEntries}} with {{#allEntries}}{{#metadata.english}}

Answered 5 days ago · Edit answer

Works beautifully! Thank you very much for your help!

Answered 5 days ago · Edit answer