add support for custom scripts on a page

This commit is contained in:
zyl 2024-06-14 22:12:12 -07:00
parent 4d1d5308d3
commit 831a1486ee
No known key found for this signature in database
GPG key ID: FDAEE0976A45AAC3
3 changed files with 9 additions and 0 deletions

View file

@ -21,6 +21,8 @@ struct TemplateData<'a, T> {
pub page: &'a str,
/// The page's title.
pub title: &'a str,
/// The page's custom scripts.
pub scripts: &'a [String],
/// Custom template data.
#[serde(flatten)]
pub extra_data: T,
@ -213,6 +215,7 @@ impl<'a> SiteBuilder<'a> {
&TemplateData {
page: page_html,
title: &title,
scripts: &page_metadata.scripts,
extra_data,
},
)?;