# How is the drop-down menu created after the CMake Docs is built from the Help directory?

**URL:** https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882
**Category:** Development
**Created:** [April 12, 2023, 7:14am UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882 "2023-04-12T07:14:52Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![hwhsu1231](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hwhsu1231/32/5358_2.png) [@hwhsu1231](https://discourse.cmake.org/u/hwhsu1231)
#### Post date: [April 21, 2023, 1:26pm UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/5 "2023-04-21T13:26:18Z")

</div>

I thinks this topic is related to this comment by @brad.king:

> [@Doc versioning mechanism](https://discourse.cmake.org/t/doc-versioning-mechanism/4814/3):
>
> We configure sphinx with a custom template directory [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/Utilities/Sphinx/conf.py.in#L29). That directory contains a custom layout template, which has [special version switch code](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/Utilities/Sphinx/templates/layout.html#L20-25) activated by passing -A versionswitch=1 when [running sphinx](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/.gitlab/os-linux.yml#L492). The version switch code loads version\_switch.js, which we publish on the web host [here](https://cmake.org/cmake/help/version_switch.js). The addition of the “This documents an old version of” and “Click here to see the latest release” is done by internal infrastructure we use to prepare the documentation for publication on cmake.org. B…

---

_[View the full topic](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882)._
