diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 6880dd5..3ab661f 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 7bfb041..bb24c3c 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")); }