sphinx-contrib / sphinxcontrib-versioning

Sphinx extension that allows building versioned docs for self-hosting.
https://sphinxcontrib-versioning.readthedocs.io/en/latest/
MIT License
127 stars 80 forks source link

Keep duplicate of root-ref in its own directory (future proof). #15

Closed Robpol86 closed 8 years ago

Robpol86 commented 8 years ago
  1. Sometimes people edit URLs to go to the latest version (e.g. they're on v1.0.1 and they know v2.0.0 is the latest so they go there directly). If v2.0.0 is the latest they'll get a 404 since it's the root ref. Once v2.0.1 is out then /v2.0.0/index.html works.
  2. When the developer switches root ref to master until the next release, /v2.0.0/index.html will exist. Then they switch back the root ref to greatest tag and now /v2.0.0/index.html doesn't work until they make the release.

Solution: when building, build the root ref twice. Once in the root and again in /.