facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.64k stars 8.34k forks source link

Easier way to support redirects #248

Closed ericnakagawa closed 4 years ago

ericnakagawa commented 6 years ago

Perhaps a bulk method for managing these -- especially helpful for an existing site migrating to Docusaurus.

"Docusaurus is pretty limited on where pages can go. For all of our sites, it's required adding a bunch of redirects to keep links working. I'd like to have an easier (automatic?) way to generate these other than copying and pasting a bunch of files in pages."

azu commented 6 years ago

I want to get this feature. My site(almin) use a workaround that embed redirect script in 404.html

For example,

endiliey commented 4 years ago

This is now possible with powerful v2 plugin system.

Example: someone created it programatically to redirect https://github.com/CanopyTax/single-spa.js.org/blob/46b46c97e0dee70b2c65c2c41484422fe399e6eb/website/src/plugins/docusaurus-plugin-redirects/src/index.js

yangshun commented 4 years ago

@endiliey should we make that plugin by @lex111 a core plugin?

endiliey commented 4 years ago

I prefer not, if we're to maintain it, we need to make it very general. That one is still hardcoded and havent support a config for from and to redirect yet, Maybe not at this point, maybe on release.

It's like how wgao tried to create another theme-no-style, thankfully its not in docusaurus repo, there's been quite some breaking change on theme implementation alrd (eg: metadata, themeconfig, etc). Pretty sure it cant work with current latest alpha

Less is better before we start to add more