From 76630e6e3a3c5602e448a691843a046fa1be258e Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Wed, 2 Aug 2023 10:06:55 -0500 Subject: [PATCH 01/16] proof of concept --- docs/conf.py | 1 + .../components/version-switcher.html | 32 +++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 54537a096..40c0a22df 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -175,6 +175,7 @@ # "footer_start": ["test.html", "test.html"], # "secondary_sidebar_items": ["page-toc.html"], # Remove the source buttons "switcher": { + "use_rtd": True, "json_url": json_url, "version_match": version_match, }, diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html index 974aa8c87..63f33074c 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html @@ -1,15 +1,21 @@ {# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript. #} - +{% if theme_switcher.get('use_rtd') is defined and theme_switcher.get('use_rtd') %} + +{% else %} + +{% endif %} From da18eb8c66f24014bbe0949ac11693ccfbf9139d Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Wed, 2 Aug 2023 10:24:30 -0500 Subject: [PATCH 02/16] see if JS is interfering --- .../pydata_sphinx_theme/components/version-switcher.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html index 63f33074c..4c5d3df04 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html @@ -1,9 +1,7 @@ {# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript. #} {% if theme_switcher.get('use_rtd') is defined and theme_switcher.get('use_rtd') %} - +
{% else %} {% else %} {% else %} {% else %}