Skip to content

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

Merged
hugovk merged 2 commits into
python:mainfrom
miketheman:miketheman/layout
Jul 29, 2023
Merged

hugovk merged 2 commits into
python:mainfrom
miketheman:miketheman/layout

Conversation

@miketheman

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

@hugovk

hugovk commented Jul 27, 2023

Copy link
Copy Markdown
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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants