diff options
| author | Xe Iaso <me@christine.website> | 2023-01-23 09:54:22 -0500 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2023-01-23 09:54:53 -0500 |
| commit | 295a2f993db8b1f7bb45d5d1d9c621ffe6400e58 (patch) | |
| tree | b2a05e83fd8ddbe0442cc887b2653b3d6d8dbba9 /src/app | |
| parent | 36e516527d76954aa5434e66102f12c2c87a8637 (diff) | |
| download | xesite-295a2f993db8b1f7bb45d5d1d9c621ffe6400e58.tar.xz xesite-295a2f993db8b1f7bb45d5d1d9c621ffe6400e58.zip | |
Add page that explains the characters in the blog
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/config.rs | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/src/app/config.rs b/src/app/config.rs index d3d93ca..7ea46fd 100644 --- a/src/app/config.rs +++ b/src/app/config.rs @@ -28,17 +28,18 @@ pub struct Config { #[serde(rename = "contactLinks")] pub contact_links: Vec<Link>, pub pronouns: Vec<PronounSet>, + pub characters: Vec<Character>, } #[derive(Clone, Deserialize, Serialize, Default)] pub struct PronounSet { - nominative: String, - accusative: String, + pub nominative: String, + pub accusative: String, #[serde(rename = "possessiveDeterminer")] - possessive_determiner: String, - possessive: String, - reflexive: String, - singular: bool, + pub possessive_determiner: String, + pub possessive: String, + pub reflexive: String, + pub singular: bool, } impl Render for PronounSet { @@ -87,6 +88,45 @@ impl Render for PronounSet { } #[derive(Clone, Deserialize, Serialize, Default)] +pub struct Character { + pub name: String, + #[serde(rename = "stickerName")] + pub sticker_name: String, + #[serde(rename = "defaultPose")] + pub default_pose: String, + pub description: String, + pub pronouns: PronounSet, + pub stickers: Vec<String>, +} + +impl Render for Character { + fn render(&self) -> Markup { + html! { + h2 #(self.sticker_name) {(self.name)} + (xesite_templates::sticker(self.sticker_name.clone(), self.default_pose.clone())) + p {(self.description)} + details { + summary { "Pronouns (" (self.pronouns.nominative) "/" (self.pronouns.accusative) ")" } + (self.pronouns) + } + + details { + summary { "All stickers" } + .grid { + @for sticker in &self.stickers { + .cell."-3of12" { + (xesite_templates::sticker(self.sticker_name.clone(), sticker.clone())) + br; + (sticker) + } + } + } + } + } + } +} + +#[derive(Clone, Deserialize, Serialize, Default)] pub struct Link { pub url: String, pub title: String, |
