summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src/components/StaticStylesheet.tsx
blob: 5c2c2a0fbd0c2735f3452c84a3b825db2e885315 (plain)
1
2
3
4
5
6
7
8
9
10
11
import { join } from "std/path/mod.ts";
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}`} />;
}