Alternatives:
Re-build:
https://github.com/sphinx-contrib/multiversion
https://sphinx-contrib.github.io/multiversion
All versions have to be re-built each time something changes.
Another variation: https://github.com/devanshshukla99/sphinx-versioned-docs
Their now apparently unmaintained predecessors seem to be:
https://github.com/sphinx-contrib/sphinxcontrib-versioning
https://github.com/Smile-SA/sphinx-versions
Fetch with JavaScript:
https://docs.readthedocs.io/en/stable/flyout-menu.html
https://docs.readthedocs.io/en/stable/versions.html
https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/version-dropdown.html
Inject into previously built HTML files:
https://github.com/steinwurf/versjon
Injects text in existing HTML files
Non-Sphinx projects with versioning:
https://docusaurus.io/docs/versioning
https://github.com/jimporter/mike (for MkDocs)