Dynamic routing with empty slug
Unanswered
American Sable posted this in #help-forum
American SableOP
Generate paths with one of the slug being empty so it matches
/3 Replies
American SableOP
I want basically do this:
My structure is
app
- [lang]
- second
I want to create
- /
- /second
- /en
- /en/second
- /fr
- /fr/second
Note this is a static export (
export async function generateStaticParams() {
return [{ lang: "en" }, { lang: "fr" }, { lang: undefined }];My structure is
app
- [lang]
- second
I want to create
- /
- /second
- /en
- /en/second
- /fr
- /fr/second
Note this is a static export (
output: export)But building results in:
I'm missing
I'm missing
/ and /secondTried catch all and optional catch all, but you have to have it as the last item :/