Create a page header struct.
This commit is contained in:
@@ -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;
|
||||
|
||||
19
src/context/page_header.rs
Normal file
19
src/context/page_header.rs
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user