blob: d919c92c766cb71283d93d66a47c7292518293b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
use crate::app::Config;
use maud::{html, Markup};
use std::sync::Arc;
pub mod nag;
pub fn xeblog_salary_history(cfg: Arc<Config>) -> Markup {
html! {
table.salary_history {
tr {
th { "Title" }
th { "Start Date" }
th { "End Date" }
th { "Days Worked" }
th { "Salary" }
th { "How I Left" }
}
@for job in &cfg.clone().job_history {
(job.pay_history_row())
}
}
}
}
pub fn xeblog_hero(file: String, prompt: Option<String>, ai: Option<String>) -> Markup {
let ai = ai.unwrap_or("MidJourney".to_string());
html! {
meta property="og:image" content={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) "-smol.png"}
figure.hero style="margin:0" {
picture style="margin:0" {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) ".webp"};
img style="padding:0" alt={"hero image " (file)} src={"https://cdn.xeiaso.net/file/christine-static/hero/" (file) "-smol.png"};
}
figcaption {
"Image generated by "
(ai)
@if let Some(prompt) = prompt { " -- " (prompt) }
}
}
}
}
pub fn xeblog_conv(name: String, mood: String, body: Markup) -> Markup {
let name_lower = name.clone().to_lowercase();
html! {
.conversation {
."conversation-picture"."conversation-smol" {
picture {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"};
img alt={(name) " is " (mood)} src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"};
}
}
."conversation-chat" {
"<"
b { (name) }
"> "
(body)
}
}
}
}
pub fn xeblog_sticker(name: String, mood: String) -> Markup {
let name_lower = name.to_lowercase();
html! {
center {
picture {
source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"};
source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"};
img alt={(name) " is " (mood)} src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"};
}
}
}
}
|