aboutsummaryrefslogtreecommitdiff
path: root/lib/xesite_templates/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xesite_templates/src/lib.rs')
-rw-r--r--lib/xesite_templates/src/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/xesite_templates/src/lib.rs b/lib/xesite_templates/src/lib.rs
index 1149aaa..2f830f8 100644
--- a/lib/xesite_templates/src/lib.rs
+++ b/lib/xesite_templates/src/lib.rs
@@ -96,6 +96,26 @@ pub fn sticker(name: String, mood: String) -> Markup {
}
}
+pub fn story(name: String) -> Markup {
+ let uuid = uuid::Uuid::new_v4();
+ let uuid = format!("{uuid}").replace("-", "");
+ let story_script = PreEscaped(format!(
+ r#"
+<script type="module">
+import {{ init }} from "/static/js/stories.js?cachebust={uuid}";
+
+init("{uuid}", "{name}");
+</script>
+"#
+ ));
+
+ html! {
+ div id=(uuid) {
+ (story_script)
+ }
+ }
+}
+
pub fn video(path: String) -> Markup {
let stream_url = format!(
"https://cdn.xeiaso.net/file/christine-static/{}/index.m3u8",