{# Version Selector Component Displays a dropdown to switch between documentation versions. Only renders when versioning is enabled. Available context: - versioning_enabled: bool - Whether versioning is enabled - versions: list[dict] - All versions with id, label, latest, url_prefix - current_version: dict|None - Current page's version info - is_latest_version: bool - Whether current page is latest version Usage in templates: {% include "partials/version-selector.html" %} Customization: Override this partial in your theme to customize the version selector. You can also style it using CSS class: .version-selector Engine-Agnostic: Uses site.get_version_target_url() method which works with any template engine (Jinja2, Mako, or BYORenderer). No global function dependency. #} {# Only show version selector if: 1. Versioning is enabled 2. There are multiple versions 3. The current page is actually versioned (has a version attribute) 4. The page is not an autodoc page (autodoc pages are not versioned) #} {% set is_autodoc = is_autodoc_page(page) if is_autodoc_page else false, page_is_versioned = page.version is not none %} {% if versioning_enabled and versions | length > 1 and page_is_versioned and not is_autodoc %}