Adding a new type of content to rss.xml

I’ve got a custom rss.xml template that shows the first 10 posts in /content/posts/ using this range statement:

{{ range first 10 (where .Site.RegularPages “Section” “posts”) }}

I’ve added a new content area called blog at /content/blog/ but both blog and posts don’t appear in the rss feed. The above shows posts, and this

{{ range first 10 (where .Site.RegularPages “Section” “blog”) }}

shows only blog posts. I’ve tried this to show both with this

{{ range first 10 (where .Site.RegularPages “Section” “posts” “blog”) }}

but that throws an error.

How do I add blog posts into the rss.xml feed? Do I need to designate the blog content in config.toml?

Check out:

Adding mainSections sounds like a solve for you.

Thanks! This works:

{{ range first 10 (where site.RegularPages “Type” “in” site.Params.mainSections) }}

and this in [params] in config.toml

mainSections = [“posts”, “blog”]

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.