v3: added customizable site emoji (logo), small visual tweaks
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { Context, Next, send } from "@oak/oak";
|
||||
import { OG_SITE_NAME } from "../config.ts";
|
||||
import { OG_SITE_NAME, SITE_EMOJI } from "../config.ts";
|
||||
import { emojiToCodepoint } from "./site-icons.ts";
|
||||
|
||||
const ICON_VERSION = emojiToCodepoint(SITE_EMOJI);
|
||||
|
||||
async function serveIndexHtml(
|
||||
context: Context<Record<string, object>>,
|
||||
@@ -7,7 +10,10 @@ async function serveIndexHtml(
|
||||
) {
|
||||
const filePath = `${root}/index.html`;
|
||||
const raw = await Deno.readTextFile(filePath);
|
||||
const html = raw.replaceAll("__SITE_NAME__", OG_SITE_NAME);
|
||||
const html = raw
|
||||
.replaceAll("__SITE_NAME__", OG_SITE_NAME)
|
||||
.replaceAll("__SITE_EMOJI__", SITE_EMOJI)
|
||||
.replaceAll("__ICON_VERSION__", ICON_VERSION);
|
||||
context.response.type = "text/html";
|
||||
context.response.body = html;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user