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

PyData Sphinx theme: DocSearch not showing on narrow screens #35

Open
kai687 opened this issue May 29, 2024 · 3 comments
Open

PyData Sphinx theme: DocSearch not showing on narrow screens #35

kai687 opened this issue May 29, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@kai687
Copy link
Collaborator

kai687 commented May 29, 2024

Split off from issue #33.

The Pydata Sphinx theme includes the searchbox twice (you can specify the template with html_theme_options.navbar_persistent). Once for wider screens and once for narrower screens.

The DocSearch UI can only be added once per page, so it's added to the element for wider screens only. This means the search is not available on narrower screens.

@agriyakhetarpal
Copy link

For those looking for a workaround or two: based on the PyData Sphinx Theme documentation, the div/template can be added under the navigation bar (navbar_center), the article header (i.e., before the heading of any page) in article_header_start, or in the primary or secondary sidebars.

@Charlie-XIAO
Copy link

Charlie-XIAO commented Jun 2, 2024

For those looking for a workaround or two: based on the PyData Sphinx Theme documentation, the div/template can be added under the navigation bar (navbar_center), the article header (i.e., before the heading of any page) in article_header_start, or in the primary or secondary sidebars.

This is not working for me (unless I'm mistaken). navbar_center and both sidebars are also included twice for different screen sizes. article_header_start does not persist as one scroll down the page which I think is not a proper place to put the search box. Only navbar_start works for me.

@agriyakhetarpal
Copy link

Oops, thanks, @Charlie-XIAO – I did mean to mention navbar_start, not navbar_center. Yes, as for article_header_start, it would render on the top of every page, but it's not going to be a fixed header on scrolling. I agree on it not being a proper place for a search box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants