This commit is contained in:
りき萌 2024-02-11 23:05:08 +01:00
parent 41180edb99
commit 81018eeafe
6 changed files with 110 additions and 0 deletions

View file

@ -202,6 +202,7 @@ impl Generator {
pub struct Page {
pub title: String,
pub thumbnail: Option<Thumbnail>,
pub scripts: Vec<String>,
pub breadcrumbs: String,
pub tree_path: Option<String>,
pub tree: String,
@ -238,6 +239,7 @@ impl Generator {
),
alt: thumbnail.alt.clone(),
}),
scripts: roots.attributes.scripts.clone(),
breadcrumbs,
tree_path: treehouse
.tree_path(parsed_tree.file_id)

View file

@ -16,6 +16,11 @@ pub struct RootAttributes {
/// ID of picture attached to the page, to be used as a thumbnail.
#[serde(default)]
pub thumbnail: Option<Picture>,
/// Additional scripts to load into to the page.
/// These are relative to the /static/js directory.
#[serde(default)]
pub scripts: Vec<String>,
}
/// A picture reference.