Im trying to customize my routes on my about-me page.
modules: [
// https://go.nuxtjs.dev/pwa
"@nuxtjs/pwa",
"nuxt-webfontloader",
"@nuxtjs/svg",
[
"@nuxtjs/prismic",
{
endpoint: "https://xxx.cdn.prismic.io/api/v2",
apiOptions: {
routes: [
{
type: "page",
path: "/:uid",
},
{
type: "about-type",
path: "/about-me/about-type",
},
{
type: "about-type2",
path: "/about-me/about-type2",
},
}
]
But the url's i get looks like this "/about". It gets cut at the hyphen. It should be /about-me/about-type2
Why do they get cut at the hyphen?
Priyanka
(Priyanka Maheshwari)
May 11, 2021, 12:47pm
3
Hello @victorthevictoriousv
Thanks for posting this question to us.
To use route-resolver, you need Slicemachine activated on their repository. Can you please send me the URL of your repository?
I am looking forward to hearing from you back.
Thanks,
Priyanka
Phil
(Phil Snow)
May 12, 2021, 8:57am
7
Hi Victor,
This is a known issue with the Route Resolver and hyphens that the team has started to fix last week.
We are tracking the issue and will update everyone below when the fix is pushed:
Hey @maxvdschee ,
I discussed this with Lucie and she explained to me what's going on. So because we removed the apiOptions for the route resolver the project then falls back on the default nuxt.js route generator, which creates the routes by crawling links.
So because the documents above aren't linked anywhere in your project their routes aren't generated by Nuxt.js.
This was something that was overcome previously by our route resolver as it does a query server-side for all Prismic documen…
Thanks.
1 Like
jake
(Jake Walters)
May 12, 2021, 9:57am
8
If you plan to have the 'about-type' as a UID you can overcome the hyphen issue on 'about-me' by creating a relationship back to the parent 'about-me' document and using a resolver.
For example, your uid page 'about type' has a relationship field 'link_to_about' that you link to 'about-me' in Prismic.
Then you can use the resolver like so:
{
type: "about-type",
path: "/:about/:uid",
resolvers: {
about: "link_to_about"
}
}
3 Likes
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
May 18, 2021, 8:43pm
9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.