Skip to content

Commit

Permalink
Use searchfield instead of searchbox component in sidebar (#217)
Browse files Browse the repository at this point in the history
This moves the search field up before the navigation. It's quite
commmon that search is near the top of the page. Also, this
results in a fixed position, because navigation is page dependent
and may be long, which could move the search field far down or
even off-page in the old layout.

The searchfield component
(sphinx-doc/sphinx#11045)
is more compact and does not have a heading, which reduces
clutter and gives more focus to the content sections.
  • Loading branch information
timhoffm committed Jul 15, 2024
1 parent 6120f75 commit eb522b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions alabaster/static/alabaster.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ div.sphinxsidebar input {
font-size: 1em;
}

div.sphinxsidebar #searchbox {
margin: 1em 0;
}

div.sphinxsidebar #searchbox input[type="text"] {
width: 160px;
}
Expand Down
2 changes: 1 addition & 1 deletion alabaster/theme.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[theme]
inherit = basic
stylesheet = alabaster.css
sidebars = about.html, navigation.html, relations.html, searchbox.html, donate.html
sidebars = about.html, searchfield.html, navigation.html, relations.html, donate.html
pygments_style = alabaster.support.Alabaster

[options]
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
html_sidebars = {
"**": [
"about.html",
"searchfield.html",
"navigation.html",
"relations.html",
"searchbox.html",
"donate.html",
]
}
Expand Down

0 comments on commit eb522b8

Please sign in to comment.