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

@@ -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,
}
}
}