use std::path::PathBuf;
use crate::models::FrontMatter;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SourcePage {
pub source_path: PathBuf,
pub relative_path: PathBuf,
pub front_matter: FrontMatter,
pub body: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UncompiledPage(pub SourcePage);
impl UncompiledPage {
pub fn new(page: SourcePage) -> Self {
Self(page)
}
pub fn inner(&self) -> &SourcePage {
&self.0
}
pub fn into_inner(self) -> SourcePage {
self.0
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CompiledPage {
pub source: SourcePage,
pub content_html: String,
}
impl CompiledPage {
pub fn new(source: SourcePage, content_html: String) -> Self {
Self {
source,
content_html,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RenderedPage {
pub output_path: PathBuf,
pub html: String,
}
impl RenderedPage {
pub fn new(output_path: PathBuf, html: String) -> Self {
Self { output_path, html }
}
}