zola/components/config/src/lib.rs
Vincent Prouillet fb994c71d7 Make search index configurable
Closes #961
2020-06-29 20:02:27 +02:00

22 lines
523 B
Rust

mod config;
pub mod highlighting;
mod theme;
pub use crate::config::{
languages::Language, link_checker::LinkChecker, taxonomies::Taxonomy, Config,
};
use std::path::Path;
/// Get and parse the config.
/// If it doesn't succeed, exit
pub fn get_config(filename: &Path) -> Config {
match Config::from_file(filename) {
Ok(c) => c,
Err(e) => {
println!("Failed to load {}", filename.display());
println!("Error: {}", e);
::std::process::exit(1);
}
}
}