[Bug] navigation.redirect usage in _dir.yml
Hello there,
I'm not sure if it's a bug or a bad usage, but I can't setup a proper redirect.
In subfolderA/0.index.md :
---
redirect: /subfolderA/subfolderB/page
---
With npm run dev everything works fine, when I go to /subfolderA I'm redirected to subfolderA/subfolderB/page, but when I run npm run generate then npm run preview (or upload on netlify), the redirection doesn't work anymore, and I have a 404 error.
I can see in the dist/public/subfolderA directory there's no index file, that would explain the 404 error, but why ? How should I do ?
Is there something I don't understand, or is it a bug ? While searching in the issues I discovered another one which is related, posted by... me. (https://github.com/nuxt-themes/docus/issues/749) but nobody answered. I'm surprised nobody else posted an issue, anyway I'm till trying to redirect !
Thanks
{
"name": "docus-starter",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate",
"preview": "nuxi preview",
"lint": "eslint ."
},
"devDependencies": {
"@nuxt-themes/docus": "^1.10.1",
"nuxt": "^3.4.1",
"rehype-katex": "^6.0.2",
"remark-math": "^5.1.1"
},
"dependencies": {
"nuxt-content-assets": "^1.3.2"
}
}
By doing further research, I can see :
- the docus website uses
navigation.redirectin a_dir.ymlfile (butnavigation.redirectis not mentioned in the docs ?), and it works if you also installfollow-redirectspackage ? - every link pointing to the folder containing the
_dir.ymlfile results in a 404 error
Is it possible to actually use the redirect option as told in the docs, or is it a deprecated thing ?
You should still be able to use navigation.redirect!
_dir.yml will never be considered as a page, but instead allows you to configure a directory and his childs behavior.