Skip to content

Commit 8bf5ad0

Browse files
committed
Redirect search to stable docs on most pages
1 parent 56c905b commit 8bf5ad0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

source/_templates/search-stable.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{# Override path to search page so we search the stable docs, except for News pages #}
2+
<script>
3+
if (window.location.pathname.startsWith("/news")) {
4+
inp = document.getElementById('search-input');
5+
inp.placeholder = "Search news ...";
6+
inp.ariaLabel = "Search news ...";
7+
} else {
8+
document.getElementsByClassName('bd-search')[0].action = "/stable/search.html";
9+
}
10+
</script>

source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
"navbar_align": "left",
107107
"navbar_center": ["initial-sections", "navbar-nav"],
108108
"navbar_end": ["theme-switcher", "navbar-icon-links"],
109+
# Search bar is overridden to the stable docs except for the "News" section
110+
"navbar_persistent": ["search-button-field", "search-stable"],
111+
109112
"show_prev_next": False,
110113
"logo": {
111114
"link": "/index.html",

0 commit comments

Comments
 (0)