From 554a441807c8285c6280ad7bd8588de44426034a Mon Sep 17 00:00:00 2001 From: stjet <49297268+stjet@users.noreply.github.com> Date: Mon, 13 Jul 2026 03:54:41 +0000 Subject: [PATCH] add fun quotes page --- index.ts | 12 +++++++++ quotes.json | 8 ++++++ templates/components/quote.html | 4 +++ templates/components/random/archive.html | 6 ----- templates/components/random/badges.html | 2 +- templates/index.html | 3 +-- templates/quotes.html | 32 ++++++++++++++++++++++++ 7 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 quotes.json create mode 100644 templates/components/quote.html delete mode 100644 templates/components/random/archive.html create mode 100644 templates/quotes.html diff --git a/index.ts b/index.ts index ec37e92..e39e470 100644 --- a/index.ts +++ b/index.ts @@ -5,6 +5,7 @@ import { Renderer } from "./ryuji.js"; import { Builder } from "./saki.js"; import _posts_metadata from "./posts/_metadata.json"; import _site_info from "./site_info.json"; +import _quotes from "./quotes.json"; export interface PostMetadata { title: string; @@ -34,6 +35,11 @@ export interface SiteInfo { icon: string; } +export interface Quote { + content: string; + from: string; +} + let renderer: Renderer = new Renderer("templates", "components"); let builder: Builder = new Builder(); @@ -157,3 +163,9 @@ builder.serve_template(renderer, "/atom.xml", "atom.xml", { last_updated: global_last_updated, }); +const quotes: Quote[] = _quotes.quotes; + +builder.serve_template(renderer, "/quotes", "quotes", { + quotes, +}); + diff --git a/quotes.json b/quotes.json new file mode 100644 index 0000000..e100c56 --- /dev/null +++ b/quotes.json @@ -0,0 +1,8 @@ +{ + "quotes": [ + { + "content": "Test quote", + "from": "Test author" + } + ] +} diff --git a/templates/components/quote.html b/templates/components/quote.html new file mode 100644 index 0000000..ef2fb64 --- /dev/null +++ b/templates/components/quote.html @@ -0,0 +1,4 @@ +
[[ quote.content ]]+ - [[ quote.from ]] +
- More random stuff
+ More random stuff
diff --git a/templates/index.html b/templates/index.html
index 29d646e..035760d 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -28,7 +28,6 @@
diff --git a/templates/quotes.html b/templates/quotes.html new file mode 100644 index 0000000..414f23f --- /dev/null +++ b/templates/quotes.html @@ -0,0 +1,32 @@ + + +
+ + +
+ + + + +
+