add fun quotes page #6
12
index.ts
12
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,
|
||||
});
|
||||
|
||||
|
||||
8
quotes.json
Normal file
8
quotes.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"quotes": [
|
||||
{
|
||||
"content": "Test quote",
|
||||
"from": "Test author"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
templates/components/quote.html
Normal file
4
templates/components/quote.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<div class="quote">
|
||||
<blockquote>[[ quote.content ]]</blockquote>
|
||||
<cite>- [[ quote.from ]]</cite>
|
||||
</div>
|
||||
@@ -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>
|
||||
@@ -8,5 +8,5 @@
|
||||
<img src="88x31/mh.gif" alt="Certified mostly harmless" loading="lazy"/>
|
||||
<img src="88x31/salt.gif" alt="Salt your passwords, OR ELSE!" loading="lazy"/>
|
||||
</div>
|
||||
<a href="/#archive">More random stuff</a>
|
||||
<a href="/#quote1">More random stuff</a>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
</div>
|
||||
<div>
|
||||
[[ 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 ]]
|
||||
<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>
|
||||
</body>
|
||||
|
||||
32
templates/quotes.html
Normal file
32
templates/quotes.html
Normal 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>
|
||||
Reference in New Issue
Block a user