Next.js Discord

Discord Forum

Duplicated Docs Folder Routing

Unanswered
Bakharwal dog posted this in #help-forum
Open in Discord
Avatar
Bakharwal dogOP
Hey, this is my current routing. as you can see there's duplicated code between [lang]/docs and docs/
The reason I did this is that if the user is on the default english locale, I don't want to the locale to be preset in the URL.
Also, the docs in [lang] have force-dynamic to avoid compiling them all in build time.

Is there another/better way to implement this behavior? Thanks!
Image

2 Replies

Avatar
Asian black bear
Avatar
Bakharwal dogOP
Thanks, what about the force-dynamic only for locales that are not english?