Merge pull request 'add fun quotes page' (#6) from master into pages
Some checks failed
Build Saki and Deploy to Github Pages / build (push) Has been cancelled
Build Saki and Deploy to Github Pages / deploy (push) Has been cancelled

Reviewed-on: #6
This commit is contained in:
2026-07-13 05:40:31 +01:00
7 changed files with 58 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import { Renderer } from "./ryuji.js";
import { Builder } from "./saki.js"; import { Builder } from "./saki.js";
import _posts_metadata from "./posts/_metadata.json"; import _posts_metadata from "./posts/_metadata.json";
import _site_info from "./site_info.json"; import _site_info from "./site_info.json";
import _quotes from "./quotes.json";
export interface PostMetadata { export interface PostMetadata {
title: string; title: string;
@@ -34,6 +35,11 @@ export interface SiteInfo {
icon: string; icon: string;
} }
export interface Quote {
content: string;
from: string;
}
let renderer: Renderer = new Renderer("templates", "components"); let renderer: Renderer = new Renderer("templates", "components");
let builder: Builder = new Builder(); let builder: Builder = new Builder();
@@ -157,3 +163,9 @@ builder.serve_template(renderer, "/atom.xml", "atom.xml", {
last_updated: global_last_updated, last_updated: global_last_updated,
}); });
const quotes: Quote[] = _quotes.quotes;
builder.serve_template(renderer, "/quotes", "quotes", {
quotes,
});

8
quotes.json Normal file
View File

@@ -0,0 +1,8 @@
{
"quotes": [
{
"content": "Test quote",
"from": "Test author"
}
]
}

View File

@@ -0,0 +1,4 @@
<div class="quote">
<blockquote>[[ quote.content ]]</blockquote>
<cite>- [[ quote.from ]]</cite>
</div>

View File

@@ -1,6 +0,0 @@
<div class="random" id="archive">
<div class="random-content">
<a href="/archive">Visit the archives</a>
</div>
<a href="/#quote1">More random stuff</a>
</div>

View File

@@ -8,5 +8,5 @@
<img src="88x31/mh.gif" alt="Certified mostly harmless" loading="lazy"/> <img src="88x31/mh.gif" alt="Certified mostly harmless" loading="lazy"/>
<img src="88x31/salt.gif" alt="Salt your passwords, OR ELSE!" loading="lazy"/> <img src="88x31/salt.gif" alt="Salt your passwords, OR ELSE!" loading="lazy"/>
</div> </div>
<a href="/#archive">More random stuff</a> <a href="/#quote1">More random stuff</a>
</div> </div>

View File

@@ -28,7 +28,6 @@
</div> </div>
<div> <div>
[[ component:random/badges ]] [[ component:random/badges ]]
[[ component:random/archive ]]
[[ component:random/quote1 ]] [[ component:random/quote1 ]]
[[ component:random/quote2 ]] [[ component:random/quote2 ]]
[[ component:random/minesweeper ]] [[ component:random/minesweeper ]]
@@ -39,7 +38,7 @@
[[ component:random/rss ]] [[ component:random/rss ]]
[[ component:random/email ]] [[ component:random/email ]]
<a id="ciran" href="/#badges" aria-hidden="true">See some random stuff</a> <a id="ciran" href="/#badges" aria-hidden="true">See some random stuff</a>
<br>An incarnation of the <a href="https://n0thanky0u.neocities.org/denparing">denpa webring</a>. <br>An incarnation of the <a href="https://n0thanky0u.neocities.org/denparing">denpa webring</a>. The <a href="/archive">archives</a>. And <a href="/quotes">fun quotes</a>!
</div> </div>
</div> </div>
</body> </body>

32
templates/quotes.html Normal file
View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quotes??</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="/styles/global.css">
<style>
blockquote {
margin-left: 25px;
}
cite {
margin-left: 50px;
}
</style>
</head>
<body>
[[ component:return ]]
[[ component:dark-mode-checkbox ]]
<div id="main">
<div>
<h2>Quotes</h2>
</div>
<div>
[[ for:quotes:quote ]]
[[ component:quote ]]
[[ endfor ]]
</div>
</div>
</body>
</html>