How can I create a custom RSS feed when using Statiq.dev (with Clean Blog theme). #194
-
In addition to the existing RSS feed, I need a custom one that will only show some articles with some specific tags (the aim is to have a RSS feed only about dotnet content). I was wondering how I can do that. I have looked at the Feeds Pipeline in the source code, I have seen that the configuration comes from the feed.yml file of the theme, but I have trouble to see how to configure correctly the feeds to add a new feed in output with a specific filter (different from the other feeds). Can someone explain to me what I need to do? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Have you seen this page in the guide: https://www.statiq.dev/guide/web/feeds? It includes all the various front-matter settings you can use to define what the feed should contain. In general, any YAML or JSON file that contains the frontmatter For many of these values you might want to use computed metadata values like this:
Is that enough to get started playing with feeds? |
Beta Was this translation helpful? Give feedback.
-
@TechWatching do you have a working example of this? @daveaglick is there a way to have it dynamically filter by any tag? |
Beta Was this translation helpful? Give feedback.
-
@daveaglick I created a new file FeedSources: => GetString("PostSources")
FeedFilter: => GetBool("IsPost") && GetList<string>("Tags").Contains("dotnet")
FeedOrderKey: Published
FeedOrderDescending: true
FeedSize: 15
FeedRss: true
FeedAtom: true When running [INFO] -> Feeds/Process » Starting Feeds Process phase execution... (0 input document(s), 3 module(s))
[ERRO] Feeds/Process » ForEachDocument » ExecuteConfig » FilterDocuments » Value cannot be null. (Parameter 'source') Is there anything else I'm missing in the above file or any other config I should add/update? (Also what would the url be? The default one is http://localhost:5080/feed.rss) |
Beta Was this translation helpful? Give feedback.
Have you seen this page in the guide: https://www.statiq.dev/guide/web/feeds? It includes all the various front-matter settings you can use to define what the feed should contain. In general, any YAML or JSON file that contains the frontmatter
FeedRss
as a value will be treated as a feed file. So to create additional feeds, create YAML files and addFeedRss: true
, etc. to the top of them. Those files can go right in your owninput
folder and the output RSS file should have a similar path as the input YAML file (with the appropriate extension, of course).For many of these values you might want to use computed metadata values like this: