Generate RSS 2.0 feeds in Typst bundles.
Slipstream queries document metadata from your Typst bundle and emits a valid RSS XML file as a bundle asset, no external tools needed.
#import "@preview/slipstream:0.1.0": slipstream
// Define your bundle pages
#document("hello.html", title: [Hello, World!])[
Welcome to my first post!
] <hello>
#document("fonts.html", title: [On Typography])[
Good typography is invisible.
] <fonts>
// To generate an RSS feed — just pass the labels!
#slipstream(
base: "https://blog.example.com",
title: "My Blog",
description: "A blog about typefaces, technology, and tea.",
<hello>, <fonts>,
)Compile with:
typst compile --features bundle,html blog.typ output/ -f bundleThis will produce output/feed.xml, output/hello.html, and output/fonts.html.
Check out a more indepth example
The main entrypoint. Call it at the top level of your bundle file alongside your #document(...) declarations.
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
str |
"feed.xml" |
Output path in the bundle |
base |
str |
"https://example.com" |
Base URL of your site |
title |
str or content |
"My Feed" |
Feed title |
description |
str or content |
"My RSS feed" |
Feed description |
language |
str or none |
none |
Language code (e.g. "en-us") |
..labels |
label |
— | Labels of documents to include |
Each label should point to a #document(...) element. Slipstream reads the document's title, path, and date to build each RSS item.
- When
date: auto(the default), today's date is used in RFC 822 format. - Pass a
datetimevalue, e.g.datetime(year: 2024, month: 6, day: 18), and it will be formatted as RFC 822 automatically. - Pass a
strto use a custom date format.
- It queries each label to get the document's metadata.
- It builds an RSS XML tree using the
xmlandrssmodules. - It calls
asset()to write the result as a file in the bundle.
xml and rss sub-modules are also available if you need direct control:
#import "@preview/slipstream:0.1.0": xml, rss
#let my-item = rss.item(
title: "Custom Title",
link: "https://example.com/custom",
description: "A hand-crafted post",
pubDate: "Mon, 01 Jan 2024 00:00:00 +0000",
)
#let feed = rss.doc(
title: "Custom Feed",
link: "https://example.com",
description: "Manual feed",
my-item,
)
#context asset("custom.xml", xml.doc(feed))Unlicense — public domain.