From ca6f5bafe72ba2f9b8ccbd6fe055d20fe590bf26 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 18 Jun 2023 23:35:49 +0900 Subject: feat(content): add icon to /about page --- nuldoc-src/pages/about.ts | 16 ++++++++++++++++ nuldoc-src/renderers/html.ts | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'nuldoc-src') diff --git a/nuldoc-src/pages/about.ts b/nuldoc-src/pages/about.ts index 3306006..504d06f 100644 --- a/nuldoc-src/pages/about.ts +++ b/nuldoc-src/pages/about.ts @@ -1,6 +1,7 @@ import { globalFooter } from "../components/global_footer.ts"; import { globalHeader } from "../components/global_header.ts"; import { pageLayout } from "../components/page_layout.ts"; +import { staticScriptElement } from "../components/utils.ts"; import { Config } from "../config.ts"; import { el, text } from "../dom.ts"; import { Page } from "../page.ts"; @@ -32,6 +33,21 @@ export async function generateAboutPage( [["class", "post-title"]], text("nsfisis"), ), + el( + "div", + [["class", "my-icon"]], + await staticScriptElement("/p5.min.js", [], config), + await staticScriptElement("/my-icon.js", [], config), + el("div", [["id", "p5jsMyIcon"]]), + el( + "noscript", + [], + el( + "img", + [["src", "/favicon.svg"]], + ), + ), + ), ), el( "div", diff --git a/nuldoc-src/renderers/html.ts b/nuldoc-src/renderers/html.ts index e4261a3..e8743c5 100644 --- a/nuldoc-src/renderers/html.ts +++ b/nuldoc-src/renderers/html.ts @@ -61,6 +61,8 @@ function getDtd(name: string): Dtd { return { type: "block" }; case "html": return { type: "block" }; + case "img": + return { type: "block" }; case "li": return { type: "block" }; case "link": @@ -71,6 +73,8 @@ function getDtd(name: string): Dtd { return { type: "block", auto_closing: true }; case "nav": return { type: "block" }; + case "noscript": + return { type: "block" }; case "ol": return { type: "block" }; case "p": -- cgit v1.2.3-70-g09d2