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 ]] +
diff --git a/templates/components/random/archive.html b/templates/components/random/archive.html deleted file mode 100644 index 806ae57..0000000 --- a/templates/components/random/archive.html +++ /dev/null @@ -1,6 +0,0 @@ -
-
- Visit the archives -
- More random stuff -
diff --git a/templates/components/random/badges.html b/templates/components/random/badges.html index 59610e3..c9bdb0e 100644 --- a/templates/components/random/badges.html +++ b/templates/components/random/badges.html @@ -8,5 +8,5 @@ Certified mostly harmless Salt your passwords, OR ELSE! - 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 @@
[[ component:random/badges ]] - [[ component:random/archive ]] [[ component:random/quote1 ]] [[ component:random/quote2 ]] [[ component:random/minesweeper ]] @@ -39,7 +38,7 @@ [[ component:random/rss ]] [[ component:random/email ]] -
An incarnation of the denpa webring. +
An incarnation of the denpa webring. The archives. And fun quotes!
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 @@ + + + + + + Quotes?? + + + + + + [[ component:return ]] + [[ component:dark-mode-checkbox ]] +
+
+

Quotes

+
+
+ [[ for:quotes:quote ]] + [[ component:quote ]] + [[ endfor ]] +
+
+ +