hi, thanks for ark, I really like its minimalistic approach and I am finding it very useful to learn what actually is a static site generator. I am also using it for my (almost non existant) blog.
I want now to implement a rss feed but I am struggling on how to go about doing that in a clean way. I see talking about it here a way to help me clear up the ideas, while maybe being also useful to others. The fact that it might have also a non zero chance to receive feedback is a nice bonus but not really required. I hope you do not mind.
I imagine it will be some kind of plugin that will need a template, it will access metadata about the site (the articles that will need to go in the feed), and it will produce an xml file.
I already have a plugin that produces a minimal set of metadata that I will need to use in the feed (which I use to list posts in my main page).
The template seems rather straightforward.
I guess the event on which I have to register the plugin could be the EXIT_BUILD event (since that list is build during RENDER_PAGE, which happens for each node during MAIN_BUILD).
the plugin could then go and access my template and write the xml file with a hardcoded name and extension and this would be one way of doing it.
another way to do it would be to create a plugin for RENDER_PAGE that will recognize a special source file (e.g. it might contain some description for the feed) and when processing that node would output a xml file. The problem for this second way is that the file_extension is site configuration and there is currently no way to override it on a node basis. I guess this could be supported by creating a suffix (or file_extension) property that can be specified in the meta dictionary and adjust accordingly this line where suffix is used.
So in the end after talking it here, there does seem some kind of query I have. The second way seems cleaner to me but it would require a new feature added to ark. In case I find the time to work on it, would you be interested in a PR that implements this per node file_extension functionality?
hi, thanks for ark, I really like its minimalistic approach and I am finding it very useful to learn what actually is a static site generator. I am also using it for my (almost non existant) blog.
I want now to implement a rss feed but I am struggling on how to go about doing that in a clean way. I see talking about it here a way to help me clear up the ideas, while maybe being also useful to others. The fact that it might have also a non zero chance to receive feedback is a nice bonus but not really required. I hope you do not mind.
file_extension
is site configuration and there is currently no way to override it on a node basis. I guess this could be supported by creating asuffix
(orfile_extension
) property that can be specified in themeta
dictionary and adjust accordingly this line where suffix is used.So in the end after talking it here, there does seem some kind of query I have. The second way seems cleaner to me but it would require a new feature added to ark. In case I find the time to work on it, would you be interested in a PR that implements this per node
file_extension
functionality?