File system routes precedence #31805
Unanswered
bernharduw
asked this question in
Help
Replies: 1 comment 1 reply
-
This sounds like you should put that special logic inside Having two pages with the same path will always be problematic, it should be unique. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hey, I'm wondering if there is a defined precedence for file-based routes.
In development, when I have a route in place like e.g.
{SanityPage__slug}.js
and add a static filepages/articles.js
it renders that file even if there is one with a slug called "articles". I'm using this to have special pages that have special treatment, while still pulling in the content from the source.However in production, the "articles" page is overwritten by the parameterized general page. This sometimes also happens when I restart development. I haven't found any pattern yet, but my expectation was that more specific paths override more general ones.
Is there a way to define the priority of which pages are used? I was wondering if reordering some plugins might change the precedence, but since there is no explicit plugin for file system routes it wouldn't actually make sense.
Beta Was this translation helpful? Give feedback.
All reactions