Partial dynamic routes #70594
Arctomachine
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
Some projects require having only few same-type pages. This can be achieved in several ways currently, but each is not optimal:
app/some-path-1
,app/some-path-2
. Cons: code duplication, cluttering app directory, changes to page structure have to be applied in each copyapp/some-path?id=1
. Cons: not good for static generation and seoapp/some-path/[id]
. Cons: these pages might not be meant to be be put under group, there might be no content for parent/some-path
page (bad for semantics)app/[slug]
. Cons: have to write additional condition and bring additional template in case this group is used for other pages already, which is not ideal to create just fixed 2-3 template pagesExample: last next conf had only 2 stages, each with identical page structure.
Proposal
Dynamic route
app/some-path-[id]
(or variations with different [id] position in name) should be valid pattern.It should abide all rules for current dynamic routes
On example of next conf it would be used like following:
As bonus, successfully implementing this pattern will allow for dynamic routes with multiple same-level variables:
/app/how-to-use-[productName]-for-[useCaseSlug]
Beta Was this translation helpful? Give feedback.
All reactions