facebook / docusaurus

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

Redirect plugin documentation should mention that effects only take on after build #3060

Closed adrianmcli closed 4 years ago

adrianmcli commented 4 years ago

πŸ“š Documentation

Re: the redirects plugin: https://v2.docusaurus.io/docs/using-plugins/#docusaurusplugin-client-redirects

I spent way too much time trying to figure out why my redirects were not working.

It turns out that I was only testing things in dev-mode (i.e. docusaurus start) rather than the built mode (i.e. after running docusaurus build and then serving it manually).

The documentation should clearly mention this with an admonition so people don't waste time trying to fiddle with their strings. Alternatively, maybe the plugin can support testing in dev mode in the future? But that's a stretch goal for another issue perhaps.

For reference, my current testing method is:

  1. yarn build (which runs docusaurus build)
  2. python3 -m http.server --directory ./build/ to serve the built files
  3. Go to your browser and try out the link (e.g. http://0.0.0.0:8000/really/old/link.html)

Have you read the Contributing Guidelines on issues?

Yes

slorber commented 4 years ago

Hey @adrianmcli , I'm sorry you lose time figuring this out.

The admonition is here on master, it's just not in the alpha 58 release but in the next/master branch, that is going to be released soon in alpha 59, so it's only bad luck due to being an early adopter of the plugin😞

We are going to release soon a new version, so this will be solved. Just waiting for DocSearch v3

See also more context here, you are unfortunately not alone 😞 also why it's more complicated to support this in dev mode: https://github.com/facebook/docusaurus/issues/2697#issuecomment-658117152

adrianmcli commented 4 years ago

Thank you for your response, no problem I understand I am an early adopter πŸ˜„