From 7f5b1f14f1890d4cb62553c4a57aa2e28f581474 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 29 Dec 2019 19:19:00 +0100 Subject: [PATCH] Search for sections (configurable via search.heading_level) Added more search configurations Display "no results found" --- _config.yml | 5 ++ _layouts/default.html | 4 ++ _sass/search.scss | 47 ++++++++++++++--- assets/js/just-the-docs.js | 91 +++++++++++++++++++++++---------- assets/js/zzzz-search-data.json | 55 ++++++++++++++++++-- 5 files changed, 161 insertions(+), 41 deletions(-) diff --git a/_config.yml b/_config.yml index a090670..c021b35 100644 --- a/_config.yml +++ b/_config.yml @@ -26,6 +26,11 @@ exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "pac # Enable or disable the site search search_enabled: true +search: + heading_level: 2 + preview_words_before: 5 + preview_words_after: 10 + rel_url: false # Set the search token separator for hyphenated-word search: search_tokenizer_separator: /[\s/]+/ diff --git a/_layouts/default.html b/_layouts/default.html index 4a66b45..81dd721 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -24,6 +24,10 @@ layout: table_wrappers Expand + + Document + +