1 min readmdxcontent
The content loader reads slug and locale straight off the filename instead of asking for both again in frontmatter.
function slugFromFile(name: string) {
const m = name.match(/^(.+)\.(de|en)\.mdx$/);
return m ? { slug: m[1], locale: m[2] } : null;
}
A new project is therefore two files - content/projects/foo.de.mdx and foo.en.mdx. No route, no index, no registry entry. generateStaticParams pulls the same slugs out of that directory at build time and the detail page comes along statically.
The side effect I only noticed later: a missing language is not an error, it is a fallback. The loader takes the other file and flags the entry - which is why a German-only note is allowed to sit here.