40 lines
994 B
Rust
40 lines
994 B
Rust
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
/// This is the struct for the natter.toml config file that ends up in each site's root directory.
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
pub(crate) struct RawConfig {
|
|
pub(super) site_title: Option<String>,
|
|
author: Option<String>,
|
|
email: Option<String>,
|
|
pub(super) use_relative_paths: Option<bool>,
|
|
pub(super) web_root: Option<String>,
|
|
pub(super) stream: Option<RawConfigStream>,
|
|
}
|
|
|
|
impl Default for RawConfig {
|
|
fn default() -> Self {
|
|
RawConfig {
|
|
site_title: None,
|
|
author: None,
|
|
email: None,
|
|
use_relative_paths: None,
|
|
web_root: None,
|
|
stream: None,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
pub(crate) struct RawConfigStream {
|
|
pub(super) entries_per_page: Option<usize>,
|
|
}
|
|
|
|
impl Default for RawConfigStream {
|
|
fn default() -> Self {
|
|
RawConfigStream {
|
|
entries_per_page: None,
|
|
}
|
|
}
|
|
}
|