diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-01-12 22:17:44 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-01-12 22:17:44 +0900 |
| commit | b14dd149e1b5f75bc494623181b19970ef830dec (patch) | |
| tree | dfff5ee9b9a9e16680fda5cba36e5c817eda1f9e /vhosts/blog/nuldoc-src/components/utils.ts | |
| parent | aecf316775c995f089012d8fec5c5cc77f6300be (diff) | |
| parent | 16182acfcc1fad2885b9c1a96fe74d8ce56a50e0 (diff) | |
| download | nsfisis.dev-b14dd149e1b5f75bc494623181b19970ef830dec.tar.gz nsfisis.dev-b14dd149e1b5f75bc494623181b19970ef830dec.tar.zst nsfisis.dev-b14dd149e1b5f75bc494623181b19970ef830dec.zip | |
Merge branch 'feature/blog-nuldoc-jsx'
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); |
