mirror of
https://github.com/getzola/zola
synced 2024-11-10 06:14:19 +00:00
* Add search into the serialized config (#2165) * Only expose index_format * Create config.search struct * cargo fmt
This commit is contained in:
parent
d72ebb1bdb
commit
8e37025729
2 changed files with 13 additions and 0 deletions
|
@ -109,6 +109,7 @@ pub struct SerializedConfig<'a> {
|
|||
build_search_index: bool,
|
||||
extra: &'a HashMap<String, Toml>,
|
||||
markdown: &'a markup::Markdown,
|
||||
search: search::SerializedSearch<'a>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
@ -331,6 +332,7 @@ impl Config {
|
|||
build_search_index: options.build_search_index,
|
||||
extra: &self.extra,
|
||||
markdown: &self.markdown,
|
||||
search: self.search.serialize(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,3 +44,14 @@ impl Default for Search {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Search {
|
||||
pub fn serialize(&self) -> SerializedSearch {
|
||||
SerializedSearch { index_format: &self.index_format }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct SerializedSearch<'a> {
|
||||
pub index_format: &'a IndexFormat,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue