|
|
@ -2,17 +2,24 @@ use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
|
|
pub enum Page {
|
|
|
|
pub enum Page {
|
|
|
|
Data(PageMetadata),
|
|
|
|
Data(PageData),
|
|
|
|
Content(String),
|
|
|
|
Content(String),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
|
|
pub struct PageMetadata {
|
|
|
|
pub struct PageData {
|
|
|
|
/// template used to render this page
|
|
|
|
/// Metadata for this page
|
|
|
|
pub template: Option<String>,
|
|
|
|
#[serde(default)]
|
|
|
|
|
|
|
|
pub metadata: PageMetadata,
|
|
|
|
|
|
|
|
|
|
|
|
/// remaining data of this page
|
|
|
|
/// remaining data of this page
|
|
|
|
/// passed to the templates when rendering
|
|
|
|
/// passed to the templates when rendering
|
|
|
|
#[serde(flatten)]
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub data: toml::Value,
|
|
|
|
pub data: toml::Value,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Default, Clone, Debug, Deserialize, Serialize)]
|
|
|
|
|
|
|
|
pub struct PageMetadata {
|
|
|
|
|
|
|
|
/// template used to render this page
|
|
|
|
|
|
|
|
pub template: Option<String>,
|
|
|
|
|
|
|
|
}
|
|
|
|