Blog
Multilingual content in WaldJS

This blog is the first place on waldjs.eu with a separate Dutch and English page per article. That needed something WaldJS couldn't do yet: content in more than one language.
One directory per language
Since the latest @waldjs/content, a collection can have subdirectories named after a locale code:
content/blog/nl/content-locales.md
content/blog/en/content-locales.md
A file with the same name in two locale directories is a translation. Collections without locale directories work exactly as before.
Three functions
getCollection('blog', { locale: 'en' })returns only the English posts.getEntry('blog', slug, { locale: 'en' })fetches one post, with a clear error if you forget which language you meant.getTranslations('blog', slug)returns every translation of a post, so a page can link to its counterpart.
Why separate pages per language
The rest of the site switches language in the browser. For long articles a URL per language is better: search engines see one language per page, lang and hreflang are right without JavaScript, and you only download the text you read.
See also the locales documentation.