zola/components/config/src/lib.rs

20 lines
516 B
Rust
Raw Normal View History

2018-10-09 12:33:43 +00:00
mod config;
pub mod highlighting;
2018-10-31 07:18:57 +00:00
mod theme;
2020-06-18 21:11:09 +00:00
pub use crate::config::{Config, languages::Language, link_checker::LinkChecker, taxonomies::Taxonomy};
2018-10-09 12:33:43 +00:00
use std::path::Path;
2017-03-06 14:45:57 +00:00
/// 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);
}
}
}