Browse Source

Fix some bugs in search

index-subcmd
Vincent Prouillet 6 years ago
parent
commit
2c538d3776
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      components/site/src/lib.rs
  2. +1
    -1
      components/site/tests/site.rs

+ 1
- 1
components/site/src/lib.rs View File

@@ -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 \


+ 1
- 1
components/site/tests/site.rs View File

@@ -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"));
}

Loading…
Cancel
Save