From 8d38e7501d668c44803427f96f5dd23d28f1d30d Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Wed, 28 Dec 2022 00:12:25 +0300 Subject: [PATCH] Add a custom local template for the RTD panel --- _static/css/custom.css | 2 +- _templates/versions.html | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 _templates/versions.html diff --git a/_static/css/custom.css b/_static/css/custom.css index f403badba..b7960215d 100644 --- a/_static/css/custom.css +++ b/_static/css/custom.css @@ -1405,7 +1405,7 @@ p + .classref-constant { position: fixed; } -/* Version selector (only visible on Read the Docs) */ +/* Read the Docs flyout panel, with language and version selectors. */ .rst-versions { background-color: var(--navbar-current-background-color); diff --git a/_templates/versions.html b/_templates/versions.html new file mode 100644 index 000000000..50e739a30 --- /dev/null +++ b/_templates/versions.html @@ -0,0 +1,60 @@ +{# Add rst-badge after rst-versions for small badge style. #} +{% set display_version = version -%} +{% set listed_languages = ({"en":"#", "de":"#", "es":"#", "fr":"#"}).items() -%} +{% set listed_versions = ({"stable":"#", "latest":"#"}).items() -%} + +{% if READTHEDOCS and current_version %} + {% set display_version = current_version -%} +{% endif %} +{% if READTHEDOCS and versions %} + {% set listed_versions = versions -%} +{% endif %} + +
+ + Read the Docs + v: {{ display_version }} + + +
+ {# + The contents of this element will be replaced in production. + But we can still have some mock data for testing. + #} + +
+
{{ _('Languages') }}
+ {% for slug, url in listed_languages %} +
{{ slug }}
+ {% endfor %} +
+
+
{{ _('Versions') }}
+ {% for slug, url in listed_versions %} +
{{ slug }}
+ {% endfor %} +
+
+ {# Translators: The phrase "Read the Docs" is not translated #} +
{{ _('On Read the Docs') }}
+
+ {{ _('Project Home') }} +
+
+ {{ _('Builds') }} +
+
+ {{ _('Downloads') }} +
+
+ +
+ + Hosted by Read the Docs + ยท + Privacy Policy + + + {##} +
+