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

trailing slash added to route for better SEO #33

Closed
wants to merge 1 commit into from

Conversation

@egidioFrat
Copy link

commented Oct 17, 2018

No description provided.

@NicoPennec

This comment has been minimized.

Copy link
Member

commented Oct 17, 2018

@egidioFrat

The generated routes come from the Nuxt.js core, not from the module.

It seems not so simple to add a trailing slash, because bar/foo !== bar/foo/ == bar/foo/index.html


maybe this module can help you: https://github.com/WilliamDASILVA/nuxt-trailingslash-module

@egidioFrat

This comment has been minimized.

Copy link
Author

commented Oct 17, 2018

Thanks.
In fact it works for me. My static routes are generated with trailing slashes.
I use another function to set generate dynamic routes in sitemap.xml

@NicoPennec

This comment has been minimized.

Copy link
Member

commented Jan 8, 2019

As explain before, the sitemap module use directly the routes generated by Nuxt.js, but currently the framework in version 2.x doesn't support trailing slash on routing.

To know more, see the following reject PR: nuxt/nuxt.js#3448 and a reason from @pi0 "Adding a trailing slash for stricter route matching would be somehow a breaking change"

But good news! Since sitemap-module version 0.2, you can create a custom filter to force trailing slash 😀

See example: be428b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.