An ATProtocol powered blogging engine.
at main 760 B view raw
1fn main() { 2 #[cfg(all(feature = "embed", feature = "reload"))] 3 compile_error!("feature \"embed\" and feature \"reload\" cannot be enabled at the same time"); 4 5 #[cfg(not(any(feature = "sqlite", feature = "postgres")))] 6 compile_error!("one of feature \"sqlite\" or feature \"postgres\" must be enabled"); 7 8 #[cfg(feature = "embed")] 9 { 10 use std::env; 11 use std::path::PathBuf; 12 let template_path = if let Ok(value) = env::var("HTTP_TEMPLATE_PATH") { 13 value.to_string() 14 } else { 15 PathBuf::from(env!("CARGO_MANIFEST_DIR")) 16 .join("templates") 17 .display() 18 .to_string() 19 }; 20 minijinja_embed::embed_templates!(&template_path); 21 } 22}