use std::sync::OnceLock;
#[derive(Debug, Clone)]
pub struct AdminBranding {
pub site_title: String,
pub site_description: String,
pub brand_color: String,
pub base_path: String,
pub restore_last_path: bool,
pub version_label: Option<String>,
}
pub fn umbral_version_label() -> String {
format!("umbral v{}", env!("CARGO_PKG_VERSION"))
}
impl Default for AdminBranding {
fn default() -> Self {
Self {
site_title: "umbral admin".to_string(),
site_description: String::new(),
brand_color: String::new(),
base_path: "/admin".to_string(),
restore_last_path: true,
version_label: Some(umbral_version_label()),
}
}
}
pub(crate) static BRANDING: OnceLock<AdminBranding> = OnceLock::new();
pub(crate) fn current() -> AdminBranding {
BRANDING.get().cloned().unwrap_or_default()
}