feat: Create config module
This commit is contained in:
parent
76744c00d4
commit
68ccc95345
10
src/site.rs
10
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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
Loading…
Reference in New Issue