From 44e62ddbd3bb3bbbe31a25249133d74b82ad6f67 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Thu, 27 Jul 2023 11:17:12 -0400 Subject: [PATCH 1/2] chore: remove unnecessary responsive layout The CSS in the base template was updated to include this directive in #7695 and released in sphinx v3.1.0. The original implementation was in #46, prior to the basic theme including it, and now we have the same meta tag duplicated. Remove the block, and reduce the duplication. Signed-off-by: Mike Fiedler --- python_docs_theme/layout.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index b4502ba..08e41df 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -82,11 +82,6 @@

{{ _('Navigation') }}

{{ super() }} {%- endblock -%} -{%- block css -%} - - {{ super() }} -{%- endblock -%} - {%- block body_tag %} {{ super() }} {%- if builder != 'htmlhelp' %} From 788fee715f2e0a4be29c7d4ac8d10c967c8e96f7 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Thu, 27 Jul 2023 11:57:20 -0400 Subject: [PATCH 2/2] fix: override correct tag When the template was made responsive, the choice was made to override the `body_tag` fragment. The `body_tag` block is a literal `` which allows the theme developer to set properties on the `body` tag. See: https://github.com/sphinx-doc/sphinx/pull/4140 Instead, use the `document` block as documented. https://www.sphinx-doc.org/en/master/development/templating.html#blocks Overriding the correct block places the `mobile-nav` section _after_ the majority of the other HTML parts, which enables the correct function of the `/` keyboard shortcut. Resolves #130 Closes #131 Closes #135 Signed-off-by: Mike Fiedler --- python_docs_theme/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index 08e41df..f830491 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -82,7 +82,7 @@

{{ _('Navigation') }}

{{ super() }} {%- endblock -%} -{%- block body_tag %} +{%- block document %} {{ super() }} {%- if builder != 'htmlhelp' %}