diff options
Diffstat (limited to 'src/templ_data/mod.rs')
-rw-r--r-- | src/templ_data/mod.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/templ_data/mod.rs b/src/templ_data/mod.rs new file mode 100644 index 0000000..6c93266 --- /dev/null +++ b/src/templ_data/mod.rs @@ -0,0 +1,30 @@ +//! Octopus template data structures +//! +//! All pages are generated by the server via template files that have +//! data inputs. Because the templates follow a well-defined +//! structure (i.e. `core` extended by `<type>/base` extended by +//! `<type>/<page>`, the structure of these template data structures +//! is the same. +//! +//! The actual page initialisation and rendering is nested in the +//! `page` module, which then uses the appropriate template structures +//! defined here. + +pub(crate) mod repo; + +/// A basic application wide template structure +pub(crate) struct BaseData { + pub version: String, + pub source: String, + pub url: String, +} + +impl Default for BaseData { + fn default() -> Self { + Self { + version: "0.2.0".into(), + source: "".into(), + url: "http://localhost:8080".into(), + } + } +} |