Static GitHub Issues

[645] Routes with one required and one optional parameter (id )

prev: Routes with one required and one optional parameter (id + slug)
next: after ssr

In my currenct project I was using a route with a dynamic pattern which constituted of two params (../:id-:slug) where the slug part was generated only for SEO purposes.

I am now trying to migrate to Nuxt (since any SEO optimization is useless, if the page is not rendered server-side), but I have no idea how to create a folder structure which generates that router pattern without duplicating the source code (one _id/index.vue file for the required :id param and a _id/_slug.vue file for the optional slug parameter which both would have the same ). Is this possible

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c559">#c559</a>)</em></sub></div>