From 2c538d3776b951c3ce077ad9a6f6ac6312c76d1a Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 20 Mar 2018 23:08:20 +0100 Subject: [PATCH] Fix some bugs in search --- components/site/src/lib.rs | 2 +- components/site/tests/site.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 6880dd5b..3ab661f4 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -204,7 +204,7 @@ impl Site { // a _index.md to render the index page let index_path = self.index_section_path(); if let Some(ref index_section) = self.sections.get(&index_path) { - if self.config.build_search_index && index_section.meta.in_search_index { + if self.config.build_search_index && !index_section.meta.in_search_index { bail!( "You have enabled search in the config but disabled it in the index section: \ either turn off the search in the config or remote `in_search_index = true` from the \ diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index 7bfb041a..bb24c3c3 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -461,5 +461,5 @@ fn can_build_search_index() { assert!(Path::new(&public).exists()); assert!(file_exists!(public, "elasticlunr.min.js")); - assert!(file_exists!(public, "search_index.js")); + assert!(file_exists!(public, "search_index.en.js")); }