From 98abcc023b99898f3a7e182e2330ea809a4c99e2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 12 Jan 2025 19:43:59 +0900 Subject: refactor(blog/nuldoc): convert components/*.ts to TSX --- vhosts/blog/nuldoc-src/components/utils.ts | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'vhosts/blog/nuldoc-src/components/utils.ts') diff --git a/vhosts/blog/nuldoc-src/components/utils.ts b/vhosts/blog/nuldoc-src/components/utils.ts index ce693100..14059b5b 100644 --- a/vhosts/blog/nuldoc-src/components/utils.ts +++ b/vhosts/blog/nuldoc-src/components/utils.ts @@ -1,28 +1,6 @@ import { Hash } from "checksum/mod.ts"; -import { join } from "std/path/mod.ts"; -import { Config } from "../config.ts"; -import { el, Element } from "../dom.ts"; -export async function stylesheetLinkElement( - fileName: string, - config: Config, -): Promise { - const filePath = join(Deno.cwd(), config.locations.staticDir, fileName); - const hash = await calculateFileHash(filePath); - return el("link", { rel: "stylesheet", href: `${fileName}?h=${hash}` }); -} - -export async function staticScriptElement( - fileName: string, - attrs: Record, - config: Config, -): Promise { - const filePath = join(Deno.cwd(), config.locations.staticDir, fileName); - const hash = await calculateFileHash(filePath); - return el("script", { src: `${fileName}?h=${hash}`, ...attrs }); -} - -async function calculateFileHash( +export async function calculateFileHash( filePath: string, ): Promise { const content = await Deno.readFile(filePath); -- cgit v1.2.3-70-g09d2