Skip to content

Conversation

@miketheman
Copy link
Member

Includes a commit removing a duplicate block.

When the template was made responsive, the choice was made to override
the body_tag fragment.
The body_tag block is a literal <body> which allows the theme developer
to set properties on the body tag.
See: sphinx-doc/sphinx#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

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 python#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 <[email protected]>
When the template was made responsive, the choice was made to override the `body_tag` fragment. The `body_tag` block is a literal `<body>` which allows the theme developer to set properties on the `body` tag. See: sphinx-doc/sphinx#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. Resolvespython#130Closespython#131Closespython#135 Signed-off-by: Mike Fiedler <[email protected]>
@mikethemanmiketheman mentioned this pull request Jul 27, 2023
@miketheman
Copy link
MemberAuthor

@hugovk I think this one is the thing we want!

@hugovk
Copy link
Member

Thanks!

Preview: https://python-docs-theme-previews--141.org.readthedocs.build/en/141/

With this, slash highlights the search box in the top right in desktop view:

image

But not the one in mobile view:

image

Which is the more useful way around.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus search box when pressing slash

2 participants

@miketheman@hugovk