summaryrefslogtreecommitdiffhomepage
path: root/services/blog/nuldoc-src/components/StaticStylesheet.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'services/blog/nuldoc-src/components/StaticStylesheet.tsx')
-rw-r--r--services/blog/nuldoc-src/components/StaticStylesheet.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/blog/nuldoc-src/components/StaticStylesheet.tsx b/services/blog/nuldoc-src/components/StaticStylesheet.tsx
new file mode 100644
index 00000000..52b695e5
--- /dev/null
+++ b/services/blog/nuldoc-src/components/StaticStylesheet.tsx
@@ -0,0 +1,11 @@
+import { join } from "@std/path";
+import { Config } from "../config.ts";
+import { calculateFileHash } from "./utils.ts";
+
+export default async function StaticStylesheet(
+ { fileName, config }: { fileName: string; config: Config },
+) {
+ const filePath = join(Deno.cwd(), config.locations.staticDir, fileName);
+ const hash = await calculateFileHash(filePath);
+ return <link rel="stylesheet" href={`${fileName}?h=${hash}`} />;
+}