Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct block, enable built-in slash keypress #141

Merged
merged 2 commits into from
Jul 29, 2023

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 <miketheman@gmail.com>
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 python#130
Closes python#131
Closes python#135

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman
Copy link
Member Author

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

@hugovk
Copy link
Member

hugovk commented Jul 27, 2023

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 free to 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