diff --git a/src/site.rs b/src/site.rs index 30eab94..2f603f5 100644 --- a/src/site.rs +++ b/src/site.rs @@ -1,4 +1,12 @@ //! Management of on-disk layout of the source of a site +use self::config::Config; + +pub mod config; + /// Representation of the on-disk structure of a site -pub struct Site {} +#[derive(Debug)] +pub struct Site { + /// Top level configuration + pub config: Config, +} diff --git a/src/site/config.rs b/src/site/config.rs new file mode 100644 index 0000000..f037bbe --- /dev/null +++ b/src/site/config.rs @@ -0,0 +1,30 @@ +//! Configuration for a site + +use serde::{Deserialize, Serialize}; + +/// Description of the domain name and related settings for a site +#[derive(Serialize, Deserialize, Debug)] +pub struct Domain { + /// The domain name itself + pub domain_name: String, + /// Should https be used + pub https: bool, +} + +impl Default for Domain { + fn default() -> Self { + Self { + domain_name: "stranger.systems".to_string(), + https: true, + } + } +} + +/// Top level configuration for a site +/// +/// Describes the file located at `site/config.dhall` +#[derive(Serialize, Deserialize, Debug)] +pub struct Config { + /// Doman name settings + pub domain: Domain, +}