From a5ceb6f15d3d0a177efd016aad5e148d42f50247 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 11 Aug 2017 14:12:24 -0400 Subject: [PATCH] Bring back local search This makes the search.html page that's generated by sphinx function as the local search, and not the global google based swift_search. The sphinx integrated search will mean that only documents linked to the current tree will be returned, which also ensures that searching for content in stable/pike doesn't jump you to mitaka answers. It also brings back highlighting of search results which is a style rule that was lost in the building of the openstackdocstheme. We probably also want sidebar integration of this search field, however this will at least mean hitting the search.html page will do what people previously expected. Change-Id: I747ad28658e12441ccad7081d15788f5d738dc5e --- .../theme/openstackdocs/layout.html | 1 + .../theme/openstackdocs/script_footer.html | 17 +++++++++++++++++ .../theme/openstackdocs/search.html | 19 +++++++++++++++++-- .../openstackdocs/static/css/combined.css | 7 ++++++- ...local-project-search-e6f00a84f2eed0a6.yaml | 12 ++++++++++++ 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/local-project-search-e6f00a84f2eed0a6.yaml diff --git a/openstackdocstheme/theme/openstackdocs/layout.html b/openstackdocstheme/theme/openstackdocs/layout.html index 7489ae45..0163b926 100644 --- a/openstackdocstheme/theme/openstackdocs/layout.html +++ b/openstackdocstheme/theme/openstackdocs/layout.html @@ -93,5 +93,6 @@ ga('send', 'pageview'); {% include 'footer.html' %} {% include 'script_footer.html' %} +{% block script_footer %}{% endblock %} diff --git a/openstackdocstheme/theme/openstackdocs/script_footer.html b/openstackdocstheme/theme/openstackdocs/script_footer.html index caee76c9..3b8c979e 100644 --- a/openstackdocstheme/theme/openstackdocs/script_footer.html +++ b/openstackdocstheme/theme/openstackdocs/script_footer.html @@ -13,6 +13,23 @@ + + + + + + + + + + {% endblock %} diff --git a/openstackdocstheme/theme/openstackdocs/static/css/combined.css b/openstackdocstheme/theme/openstackdocs/static/css/combined.css index 9f7e1e82..e04f4ec7 100644 --- a/openstackdocstheme/theme/openstackdocs/static/css/combined.css +++ b/openstackdocstheme/theme/openstackdocs/static/css/combined.css @@ -1778,7 +1778,7 @@ footer { .footer-links h3 { color: #fff; - font-size: 14px; + font-size: 14px; } .footer-links ul { @@ -4653,6 +4653,11 @@ img.align-right, .figure.align-right { margin-right: 0; } +/* for search result highlighting */ +span.highlighted { + background-color: #fbe54e; +} + /*img.align-left {*/ /* display: table;*/ /* margin-left: 0;*/ diff --git a/releasenotes/notes/local-project-search-e6f00a84f2eed0a6.yaml b/releasenotes/notes/local-project-search-e6f00a84f2eed0a6.yaml new file mode 100644 index 00000000..429867f2 --- /dev/null +++ b/releasenotes/notes/local-project-search-e6f00a84f2eed0a6.yaml @@ -0,0 +1,12 @@ +--- +prelude: > + Adds scoped search so that readers can search within project documentation + only. +features: + - | + Adds ability to use the Sphinx search implementation only for the content + for the project, such as nova or keystone. The default settings set the + search scope to within the built version and only for .html files. + + - Readers access the search functionality through a link to Search from the + top-most landing page for the project documentation.