add support for thumbnails

This commit is contained in:
りき萌 2024-02-08 11:34:09 +01:00
parent d7e42667fe
commit 4c24c0354c
6 changed files with 96 additions and 8 deletions

View file

@ -15,7 +15,18 @@ pub struct RootAttributes {
/// ID of picture attached to the page, to be used as a thumbnail.
#[serde(default)]
pub thumbnail: Option<String>,
pub thumbnail: Option<Picture>,
}
/// A picture reference.
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct Picture {
/// ID of the picture.
pub id: String,
/// Optional alt text.
#[serde(default)]
pub alt: Option<String>,
}
/// Branch attributes.