-
-
Notifications
You must be signed in to change notification settings - Fork 635
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
fix: uppercase in path #2170
fix: uppercase in path #2170
Changes from 6 commits
1aa56b3
3608cd5
dc39b23
62fa6c3
8ba7a20
76cde2a
4d47939
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,8 @@ const isPartial = (path: string): boolean => path.split(/[:/]/).some(part => par | |
* @returns generated slug | ||
*/ | ||
export const generatePath = (path: string, { forceLeadingSlash = true } = {}): string => { | ||
path = path.split('/').map(part => slugify(refineUrlPart(part), { lower: true })).join('/') | ||
const { content } = useRuntimeConfig().public | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should avoid using Nuxt generated helpers (like There is already several usecases of parser outside of Nuxt.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, I've now moved it into the options of the transformer. |
||
path = path.split('/').map(part => slugify(refineUrlPart(part), { lower: !content.respectPathCase })).join('/') | ||
return forceLeadingSlash ? withLeadingSlash(withoutTrailingSlash(path)) : path | ||
} | ||
|
||
|
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.
Maybe you could provide an example to help dev to understand types of issues that this option can solve
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.
Added!
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.
Perfect π