New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving middleware file #36009
Moving middleware file #36009
Conversation
Co-authored-by: JJ Kasper <jj@jjsweb.site>
@@ -142,10 +142,6 @@ | |||
} | |||
] | |||
}, | |||
{ | |||
"title": "Middleware", | |||
"path": "/docs/middleware.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we want to keep this entry and update the path to /docs/advanced-features/middleware.md
to go along with the redirect. This should resolve the failing check here https://github.com/vercel/next.js/runs/5888873149?check_suite_focus=true#step:4:5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijjk Ahh, thank you! I was getting a little confused around how redirects work for these docs. So I understand for the future when we want to move something:
- Keep the location but update the path to where we want it? (Will this make it confusing for someone coming to the file in the future if this file doesn't mimic the site nav?)
- The path and redirect path should be the same, but that path uses the .md file type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for non-redirect paths it should have the .md
extension and points to a file in the docs folder, this is what the lint step is mainly checking for to ensure we don't forget to add manifest entries or have typos.
For redirect paths it doesn't need to have .md
as it's matching the path directly without checking the filesystem and the lint step doesn't check these. The destination for the redirect can be any url so if we need to move docs to another site we can e.g. https://vercel.com/docs/some/path
but in this case it can just be /docs/advanced-features/middleware
since it's the same site.
Seems like it would be good to add this to our contributing, I'll create a PR with notes on this and request your review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened PR with the above info here #36020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijjk Thank you so much for taking the time to explain this. The added example in the contributing doc was super helpful!
This PR fixes a request from
@rauchg
that we specify more clearly that Middleware is Beta and organize it properly within the navigation.Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples
yarn lint