Skip to content
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

DX utility for trailing slashes #6339

Open
manniL opened this issue Sep 1, 2019 · 1 comment
Open

DX utility for trailing slashes #6339

manniL opened this issue Sep 1, 2019 · 1 comment

Comments

@manniL
Copy link
Member

@manniL manniL commented Sep 1, 2019

Related PR: #6331
Suggested by @pimlie

When trailing slash handling is enforced (in any manner), it'd be great to have two things for improved DX:

Nuxt Link adaption

No matter how you input the links in your Nuxt link (be it as an object via named routes or via string), the component should enforce the set up trailing slash handling (adding or removing the slashes as needed).

Utility function for Nuxt modules

To ensure that all modules (like https://github.com/nuxt-community/redirect-module or https://github.com/nuxt-community/sitemap-module) have the same implementation of trailing slash handling, we should provide a utility for that.

@pimlie
Copy link
Member

@pimlie pimlie commented Sep 5, 2019

So basically these DX tools could be an adaption of these utilities. Here are the corresponding unit tests.

They'd probably only need to be adapted to use a nuxt config setting of whether to enforce the trailing slash or not. @manniL feel free to copy what you need if you want to look in to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.