Allow different slug names for the same dynamic path #14588
ricokahler
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.
-
Feature request
Is your feature request related to a problem? Please describe.
I'm currently in the process of taking a WordPress site headless with Next.js (thanks to 9.3 🙌). In WordPress, there are pages and posts (among other entities) that can create URLs with slugs top level (e.g.
https://example.com/my-blog-post/
,https://example.com/some-page/
). I think for SSG, it's reasonable to allow different templates for the same dynamic path scheme.Describe the solution you'd like
I'd like to be able to do something like this:
It seems like this is possible if the
getStaticPaths
does not return conflicting paths and if either both (or possibly just one) file hasfallback
set tofalse
.Describe alternatives you've considered
I could get around this by adding some manual routing between the two different slugs but it requires get the paths and pulling them into the component to do matching.
Even if these pages share the same dynamic path, the component templates are different so it'd be nice if next would handle this case.
Additional context
Gatsby allows these kind of schemes already via their
createPage
API. I think that + the fact the WordPress has top-level URL slugs with different templates justifies implementing this.Beta Was this translation helpful? Give feedback.
All reactions