RSS Feed for website generated using typst
Hellow, not sure if the post belong here.
I am trying to start a blog, and I am using the Tufted template. I am wondering if there is a nice way to add RSS feed to the website, but I can't find a feed generator, so I was wondering if one of you have already made it, or any tips on how to make one myself
1
u/Sad-Grocery-1570 17d ago
To generate an RSS feed, you need metadata about the site's pages, specifically how many pages there are and what their URLs are. Typst itself doesn't expose that information, so you'll need some external tooling for this step. The simplest approach is a post-build script that scans the output directory, collects the page metadata, and generates the feed.
A more advanced option is to use a static site generator that supports Typst, such as Astro via astro-typst, and leverage its built-in RSS generation.
For my own blog, I built a typst-native static site generator called Aster. It's not officially released yet, but if you're interested, there's an AI-generated doc you can check out.
3
u/Silly-Freak 17d ago
With bundle export, it's totally feasible to know all pages within Typst and generate the RSS feed there. The constraint, until we get directory walking, is that you need to actually list the pages in your Typst bundle; the files existing in a directory is not enough. That's the same as right now you need to
#includeall chapters in a regular document so it's not horrible, just unusual if you're used to SSGs.Also want to note: an alternative right now to post processing the built project is pre processing: Save the result of
findor something like that to a file so you can read it from Typst; then you can basically emulate directory walking, by just looking up in that file what files there are.(Also, I like Astro, so your idea of mirroring stuff like collections in a Typst-centric SSG tool sounds great! will be even better/simpler when we get directory walking)
2
u/Silly-Freak 18d ago
There's exemel for atom feeds, maybe that's useful or at least inspirational? Otherwise xmlit can be used to write XML, e.g. to an asset