diff options
Diffstat (limited to 'src/templ_data/mod.rs')
-rw-r--r-- | src/templ_data/mod.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/templ_data/mod.rs b/src/templ_data/mod.rs index 6c93266..7645e95 100644 --- a/src/templ_data/mod.rs +++ b/src/templ_data/mod.rs @@ -10,21 +10,29 @@ //! `page` module, which then uses the appropriate template structures //! defined here. -pub(crate) mod repo; +pub(crate) mod overview; +pub(crate) mod files; + +use std::env; /// A basic application wide template structure pub(crate) struct BaseData { pub version: String, pub source: String, - pub url: String, + pub siteurl: String, + pub sitename: String, + pub has_wiki: bool, } impl Default for BaseData { fn default() -> Self { Self { - version: "0.2.0".into(), - source: "".into(), - url: "http://localhost:8080".into(), + version: env!("CARGO_PKG_VERSION").into(), + source: env::var("_OCTOPUS_SOURCE") + .unwrap_or("https://dev.spacekookie.de/web/octopus".to_string()), + siteurl: env::var("_OCTOPUS_SITE_URL").unwrap_or("localhost:8080".to_string()), + sitename: env::var("_OCTOPUS_SITE_NAME").unwrap_or("test-octopus".to_string()), + has_wiki: true, } } } |