feat: add syntax highlighting and fix code alignment

This commit is contained in:
2025-12-10 11:46:41 -08:00
parent 07aa12a042
commit bbac528845
6 changed files with 117 additions and 32 deletions
+2 -1
View File
@@ -7,6 +7,7 @@
import Markdown from "react-markdown";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import rehypeHighlight from "rehype-highlight";
import type { JSX } from "react";
import { Rule } from "@/components/rule";
import { getPostData } from "@/lib/posts";
@@ -34,7 +35,7 @@ const Page = async({
<h2 className="text-center">{post.data.summary}</h2>
<p className="text-center">{`A ${post.data.readtime}.`}</p>
<Rule />
<Markdown rehypePlugins={[ rehypeRaw ]} remarkPlugins={[ remarkGfm ]}>
<Markdown rehypePlugins={[ rehypeRaw, rehypeHighlight ]} remarkPlugins={[ remarkGfm ]}>
{post.content}
</Markdown>
<Rule />