Stories in folders do not work


In the content section I have a page called “About Us”.
I also created a folder named “Pages” wherein I have a page called “Partners”.
So I expect /about-us to work (it does) and also /pages/partners to work (but that does not, gives 404).
More specifically:

Request failed with status code 404

at Server.nodeHandler (/C:/[...]/node_modules/h3/dist/index.mjs:540:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Any idea what might the problem here?

Not sure if related: I use “npm run generate” and see that it fails on the link to the partners page using url: '/cdn/stories/pages,partners',

There should be a slash “/” between pages and partners.pages/partners

Just making sure about your folder structure:

  • About US (/about-us)
  • Pages (Folder)
    • Partners (/pages/partners) except it his marked as “home” page for this folder, than it is reachable via /pages

I found the solution:

let {slug} = useRoute().params
if (slug.length > 1) slug = slug.join('/')