Nuxt & Storyblok: point home page to both root "/" and "/home"?

541 views Asked by At

I'm trying to set up a nuxt project with StoryBlok. It's going to be a single-page brochure site so the only page I have is my index. I am having some problems here because StoryBlok is not allowing me to point my home page to simply /, it requires me to point it to a folder or a slug.

I know that having an empty slug will screw up StoryBlok's API structure so I understand why that doesn't work, however I need to find a workaround so that I can allow my team to update our / homepage using StoryBlok and so they can see the page in StoryBlok's editor

I'm thinking a good way to go around this might be to have Nuxt point to both / and /home? Is there a good way to do this since Nuxt doesn't have a routing file?

Alternatively, do you know a different method to go about linking to the correct page?

2

There are 2 answers

0
kissu On

As explained in my answer here, you can use router-extras to have more configuration regarding your routes. Something like this in /pages/index.vue

<router>
{
  alias: [
    'home',
  ]
}
</router>

should do the trick.

0
Jack Shelton On

enter image description here

There is a Real Path option in storyblok that allows you to edit the root path in the visual editor, while using the /home path for storyblok.