Create a page header struct.

This commit is contained in:
Tom Alexander
2023-12-17 14:28:27 -05:00
parent 1ff41940a5
commit 35dbab0ceb
6 changed files with 34 additions and 6 deletions

View File

@@ -35,6 +35,7 @@ mod line_break;
mod macros;
mod object;
mod org_macro;
mod page_header;
mod paragraph;
mod plain_link;
mod plain_list;
@@ -69,4 +70,5 @@ pub(crate) use footnote_definition::RenderRealFootnoteDefinition;
pub(crate) use global_settings::GlobalSettings;
pub(crate) use heading::RenderHeading;
pub(crate) use object::RenderObject;
pub(crate) use page_header::PageHeader;
pub(crate) use section::RenderSection;

View File

@@ -0,0 +1,19 @@
use serde::Serialize;
/// The header that goes above the content of the page.
///
/// This header will be mostly the same on every page.
#[derive(Debug, Serialize)]
pub(crate) struct PageHeader {
website_title: Option<String>,
home_link: Option<String>,
}
impl PageHeader {
pub(crate) fn new(website_title: Option<String>, home_link: Option<String>) -> PageHeader {
PageHeader {
website_title,
home_link,
}
}
}