Fix some bugs in search

This commit is contained in:
Vincent Prouillet 2018-03-20 23:08:20 +01:00
parent b0363298f5
commit 2c538d3776
2 changed files with 2 additions and 2 deletions

View file

@ -204,7 +204,7 @@ impl Site {
// a _index.md to render the index page // a _index.md to render the index page
let index_path = self.index_section_path(); let index_path = self.index_section_path();
if let Some(ref index_section) = self.sections.get(&index_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!( bail!(
"You have enabled search in the config but disabled it in the index section: \ "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 \ either turn off the search in the config or remote `in_search_index = true` from the \

View file

@ -461,5 +461,5 @@ fn can_build_search_index() {
assert!(Path::new(&public).exists()); assert!(Path::new(&public).exists());
assert!(file_exists!(public, "elasticlunr.min.js")); assert!(file_exists!(public, "elasticlunr.min.js"));
assert!(file_exists!(public, "search_index.js")); assert!(file_exists!(public, "search_index.en.js"));
} }