I'm trying to create a dynamic path for my posts with the new route resolver (yes, slice machine is activated). I have used these docs for the route resolver and I'm using exactly the same setup.
The problem I'm having is that the category
part (example 3. With a Parent) doesn't really work properly.
As you can see below, the url should be /en/hello-world/the-post
. hello-world
is the category and the-post
the post uid. The url does work, but so does for example /en/jdhfjks/the-post
. So the category
isn't really defined.
And as you can see in the data section, it does recieve hello-world
as parent uid.
This is my route:
{
type: 'post',
path: '/:lang/:category/:uid',
resolvers: {
category: 'category'
}
}
And I'm using the nuxt-multi-language-site, the only difference is that I also have a dynamic _uid.vue
file for the post. Which is in ~/pages/_lang/_category/_uid.vue
(with a _category.vue
import in the root of pages).
Can you help me figure out why I can type in anything in the category
part and it works? This shouldn't be the case.