zola/components/config/src/lib.rs
2020-02-02 17:48:43 -08:00

20 lines
492 B
Rust

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