use std::env;
#[derive(Debug, Clone)]
pub struct BaseStore {
pub site_name: String,
pub body_embed: String,
pub starstraw: String,
pub static_dir: String,
pub nested: String,
}
impl BaseStore {
pub fn new() -> Self {
Self {
site_name: match env::var("PO_SITE_NAME") {
Ok(s) => s,
Err(_) => String::from("Pongo"),
},
body_embed: match env::var("PO_BODY_EMBED") {
Ok(s) => s,
Err(_) => String::new(),
},
starstraw: match env::var("PO_STARSTRAW") {
Ok(s) => s,
Err(_) => panic!("Starstraw is required to use Pongo."),
},
static_dir: match env::var("PO_STATIC_DIR") {
Ok(s) => s,
Err(_) => {
panic!("No static dir has been provided! Pongo needs client files to function.")
}
},
nested: match env::var("PO_NESTED") {
Ok(s) => s,
Err(_) => String::from("@pongo"),
},
}
}
}