Option to add trailing slash to routes, especially static ones

manniL
5.7k
manniL
commented 11 days ago

What problem does this feature solve?

We can already add a trailing slash to our own defined routes, but there is no way (AFAIK) yet to add it to generated/static routes.

e.g.
/about -> /about/ (while there is a pages/about.vue)

idea
0
NicoPennec
1.4k
NicoPennec
commented 10 days ago

(duplicate #34)

You can use the filter option.
see the 2nd example: https://github.com/nuxt-community/sitemap-module#filter-optional

But if you apply the trailing slash, you will have duplicate contents between /about and /about/ paths. So a 301 redirection will be mandatory (to solve that issue => https://github.com/WilliamDASILVA/nuxt-trailingslash-module)

Currently the root cause comes from an issue in the framework Nuxt 2.x itself 🀷
Please, read my comment here : https://github.com/nuxt-community/sitemap-module/pull/33#issuecomment-452135626
and the @pi0 comment here: https://github.com/nuxt/nuxt.js/pull/3448#pullrequestreview-131063268

0
manniL
5.7k
manniL
commented 9 days ago

Thanks! ☺️

0
Informations
Feature Request β€’ Open
#c60 - Created 11 days ago