From 7c72e62552af1a4d1e597f0db60b5caab648d6b0 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 15 Nov 2017 10:19:37 -0500 Subject: [PATCH] Site: Search with @Algolia DocSearch (#6557) Merge pull request 6557 --- docs/_includes/header.html | 1 + docs/_includes/search/input.html | 1 + docs/_includes/search/script.html | 9 ++++++ docs/_includes/top.html | 1 + docs/_layouts/default.html | 2 +- docs/_sass/_docsearch.scss | 50 +++++++++++++++++++++++++++++++ docs/_sass/_style.scss | 1 + docs/css/screen.scss | 1 + 8 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 docs/_includes/search/input.html create mode 100644 docs/_includes/search/script.html create mode 100644 docs/_sass/_docsearch.scss diff --git a/docs/_includes/header.html b/docs/_includes/header.html index 2577a807..cca35e89 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -13,6 +13,7 @@ diff --git a/docs/_includes/search/input.html b/docs/_includes/search/input.html new file mode 100644 index 00000000..729f5cab --- /dev/null +++ b/docs/_includes/search/input.html @@ -0,0 +1 @@ + diff --git a/docs/_includes/search/script.html b/docs/_includes/search/script.html new file mode 100644 index 00000000..f770c63a --- /dev/null +++ b/docs/_includes/search/script.html @@ -0,0 +1,9 @@ + + diff --git a/docs/_includes/top.html b/docs/_includes/top.html index 155ffbca..b67648d9 100644 --- a/docs/_includes/top.html +++ b/docs/_includes/top.html @@ -7,6 +7,7 @@ {% feed_meta %} + {% seo %} diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 77ebd5f7..8e9574ad 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -8,6 +8,6 @@ {% include footer.html %} {% include anchor_links.html %} {% include analytics.html %} - + {% include search/script.html %} diff --git a/docs/_sass/_docsearch.scss b/docs/_sass/_docsearch.scss new file mode 100644 index 00000000..bebe3125 --- /dev/null +++ b/docs/_sass/_docsearch.scss @@ -0,0 +1,50 @@ +.searchbox { + .searchbox__input { + padding: 5px 5px 5px 29px; + border: none; + border-radius: 5px; + color: #444; + + &::-webkit-input-placeholder { + color: #aaa; + } + + &:-ms-input-placeholder { + color: #aaa; + } + + &::placeholder { + color: #aaa; + } + } +} + +.algolia-autocomplete { + .ds-dropdown-menu { + font-size: 1rem; + text-shadow: none; + + .ds-suggestion.ds-cursor .algolia-docsearch-suggestion:not(.suggestion-layout-simple) .algolia-docsearch-suggestion--content { + background-color: rgba(221, 221, 221, 0.5); + } + } + + .algolia-docsearch-suggestion--category-header { + background-color: #444; + color: #ddd; + padding: 0.35em; + } + + .algolia-docsearch-suggestion--subcategory-column { + color: #444; + } + + .algolia-docsearch-suggestion--highlight { + background-color: #fc0; + color: #222; + } + + .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 #fc0; + } +} diff --git a/docs/_sass/_style.scss b/docs/_sass/_style.scss index 38276c8f..fe84083a 100644 --- a/docs/_sass/_style.scss +++ b/docs/_sass/_style.scss @@ -62,6 +62,7 @@ nav { padding: 0; margin: 0; white-space: nowrap; + display: inline-block; } li { display: inline-block; } diff --git a/docs/css/screen.scss b/docs/css/screen.scss index 2eff7f89..4bc6bec3 100644 --- a/docs/css/screen.scss +++ b/docs/css/screen.scss @@ -7,3 +7,4 @@ @import "pygments"; @import "font-awesome"; @import "style"; +@import "docsearch";