zola/components/config/src/lib.rs
2020-06-18 23:11:09 +02:00

20 lines
516 B
Rust

mod config;
pub mod highlighting;
mod theme;
pub use crate::config::{Config, languages::Language, link_checker::LinkChecker, taxonomies::Taxonomy};
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);
}
}
}