Replies: 3 comments
-
I've been taking a look at scenarios like this one from Static Tweet Next.js Demo which is close to what I'd need to cover my use case. However, this still doesn't take into account "partially static" params and would generate potentially hundreds of different pages (one for each tweet that gets requested). Another take on this would be to do without the |
Beta Was this translation helpful? Give feedback.
-
Check out the new i18n RFC and give us your feedback! 🚀 |
Beta Was this translation helpful? Give feedback.
-
Hey, @leerob, thanks for pointing that out! Good stuff. I actually saw and read through the RFC yesterday - but did not see this particular use case mentioned (at least, not explicitly). Would |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to build an entirely static web app, I'm facing an issue where some
params
in my page URL are known at build-time, but some aren't.Example:
/[lang]/blog/[slug]/edit
.[lang]
can be set when building the app and, as expected, changes i18n settings within the app.[slug]
depends on which blog post the user is editing.The
edit.js
page looks exactly the same for every blog post: it's a form with pre-filled inputs based on[slug]
. It wouldn't make much sense to generate a slightly different.html
file for each blog post - not to mention, that would amount to hundreds of pages. Instead, I'd like to fetch the post data byslug
client-side, while still be able to pre-render i18n texts on the page.However,
getStaticPaths
makes setting bothlang
andslug
params mandatory. Is there a way to work around this? In short, I would need[lang]
to be statically set at build-time, but keep[slug]
as a dynamic router param.Beta Was this translation helpful? Give feedback.
All reactions