umi-next icon indicating copy to clipboard operation
umi-next copied to clipboard

feat(plugin-docs): Add redirect support

Open yuaanlin opened this issue 2 years ago • 1 comments

plugin-docs 加入了基于约定式路由的重导向配置能力。

使用场景

有时候有些路由本身并没有内容,我们希望当这个路由被打开的时候可以直接重导向到他下面的某个子路由,例如:

/docs 这一页是空的,我们希望当有人进入 /docs 时会自动被重导向到 /docs/tutorials/getting-started 页面。

使用方式

只要在 /docs/docs/README.md 也就是我们想要进行重导向的页面,在第一行写上

[redirect]:- "./tutorials/getting-started"

这样当有人进入这个页面,就会被重导向到他设置的页面中。

yuaanlin avatar Apr 22 '22 08:04 yuaanlin

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
umi-next ✅ Ready (Inspect) Visit Preview Apr 22, 2022 at 8:21AM (UTC)

vercel[bot] avatar Apr 22 '22 08:04 vercel[bot]