Conversation

brb, generating my website's RSS feed with Typst :3 (yes, in bundle mode, with several fun hacks to get nice infrastructure)

3
0
0

@bal4e The source of your Web site is entirely in Typst?

1
0
0

@bortzmeyer yeah! maybe you already heard, but Typst has supported (experimental) HTML output for almost(?) a year now. I moved my website to it a while back, but I am currently rewriting the code to use the recently-released bundle mode. The website code is not public, but you can access index.typ at every page, e.g. https://bal-e.org/blog/index.typ.

0
0
0
@bal4e Mine is a odd mix of typst for content and rust for everything else, so my rss feed is generated from toml embedded as comments in the top of my content files.

Example post: https://git.sr.ht/~erk/hs/tree/main/item/posts/rangefrom-part-2.typ
Atom feed generation: https://git.sr.ht/~erk/hs/tree/main/item/src/posts.rs#L134
2
0
1
@bal4e Bundle mode was not really ready when I first got the idea to make this website so I never looked too much into that
0
0
1

@erk huh, that's really cool!

1
0
1

@erk In my case, I ended up building my own version of html.elem() for XML so I could semi-nicely encode the Atom feed data. The only drawback thus far: with my new infrastructure, I can include previews of posts in the Atom feed; but Typst doesn't offer a way to render content into HTML fragments programmatically, so I'm just stripping HTML tags from the previews. I guess I could recursively traverse content and serialize it to HTML myself, but that does not sound very fun. I managed to implement simple XML escaping so hopefully things will not be too janky.

I mean to put up the website code in an easy-to-access way sometime, so I can share all my hacks, but it's hard to find a way to do that without revealing secret pages. I keep it all in a private Codeberg repo right now, so that it is backed up in case my laptop dies.

1
0
1
@bal4e That sounds pretty cool, I simply skipped over adding content to my atom feeds, but at some point I will probably have to get back to it.

Most of my current hacks are in the style file I use (https://git.sr.ht/~erk/hs/tree/main/item/posts/govuk.tpl)

I used to have some pretty bad ones with rewriting HTML after generation to add syntax highlighting, but that just works now. (https://erk.dev/2025/04/19/bureaucracy)

Typst is really nice to use for this because it is much more "programmable" than markdown and is in my opinion just much nicer to write in.
0
0
1

@bal4e, unrelated, but may I ask you how do you sustain ai scrappers? That's my only worry of moving to a VPS I have.

1
0
0

@yoh I currently host my website on @ubernauten, which has been really smooth, and IIRC I have HTTP access logs turned off so I have no idea what the traffic is like. Apparently it's not been bad enough to take anything down, and the server admins seem to do a good job of keeping everything stable. I don't think I have any helpful info for you, sorry.

0
0
0