Doc versioning mechanism

@brad.king

Execuse me. I wondered how is the “Version Switcher” added into the HTML page after using -A versionswitch=1 in the command-line?

The following commands are what I use to build the CMake Docs locally:

sphinx-build --version
git clone --depth 1 --no-single-branch https://github.com/Kitware/CMake.git
cd CMake
git checkout v3.25.1 --quiet
git describe --tag
mkdir build && cd build
cmake ../Utilities/Sphinx -GNinja -DSPHINX_HTML=ON -DSPHINX_FLAGS="-A versionswitch=1"
cmake --build .

And the following is the code snippet of its HTML code:

Compared to the HTML downloaded from cmake.org, we can see that there are lots of stuff inside the <span class="version_switch"></span> label:

How does CMake Team modify this snippet in every HTML file when publishing and hosting on cmake.org?