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 @@ + + +
+ + +
+ + + + +
+