Fix some bugs in search
This commit is contained in:
parent
b0363298f5
commit
2c538d3776
|
@ -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 \
|
||||||
|
|
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue