From 5e2acb0eb88a231ec1bc86350ce22f967cdf2ed2 Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Mon, 1 Jul 2024 13:17:06 +0200 Subject: [PATCH] feat(css): :sparkles: add gfm css --- routes/_app.tsx | 1 + routes/imports/markdown_css.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 routes/imports/markdown_css.ts diff --git a/routes/_app.tsx b/routes/_app.tsx index 9c3c5b4..a73fc70 100644 --- a/routes/_app.tsx +++ b/routes/_app.tsx @@ -38,6 +38,7 @@ export default function App({ Component }: PageProps) { type='image/x-icon' /> +
diff --git a/routes/imports/markdown_css.ts b/routes/imports/markdown_css.ts new file mode 100644 index 0000000..134c45b --- /dev/null +++ b/routes/imports/markdown_css.ts @@ -0,0 +1,14 @@ +import { Handlers } from '$fresh/server.ts' +import { CSS, KATEX_CSS } from 'gfm' + +export const handler: Handlers = { + GET() { + const styles = CSS + KATEX_CSS + return new Response(styles, { + headers: { + 'Content-Type': 'text/css; charset=utf-8', + // TODO add cache headers and eTag + }, + }) + }, +}