diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-01-12 19:43:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-01-12 21:37:23 +0900 |
| commit | 98abcc023b99898f3a7e182e2330ea809a4c99e2 (patch) | |
| tree | be8aab31e6185dabac929146426a52dd3b98b26c /vhosts/blog/nuldoc-src/components/utils.ts | |
| parent | f3a77cb2f83ff2f91a5cc78da2bd735ad0d4edec (diff) | |
| download | nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.tar.gz nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.tar.zst nsfisis.dev-98abcc023b99898f3a7e182e2330ea809a4c99e2.zip | |
refactor(blog/nuldoc): convert components/*.ts to TSX
Diffstat (limited to 'vhosts/blog/nuldoc-src/components/utils.ts')
| -rw-r--r-- | vhosts/blog/nuldoc-src/components/utils.ts | 24 |
1 files changed, 1 insertions, 23 deletions
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<Element> { - 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<string, string>, - config: Config, -): Promise<Element> { - 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<string> { const content = await Deno.readFile(filePath); |
