Enhance code block styling with rehype-pretty-code integration and update package dependencies
Some checks failed
Build and Deploy Blog / build-and-deploy-local (push) Has been cancelled

This commit is contained in:
2026-03-31 02:02:40 +02:00
parent 379c6063c6
commit 902521e1f3
4 changed files with 144 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import { getPostData, getAllPostIds } from "@/lib/posts";
import type { PostData } from "@/lib/posts";
import Window from "../../../components/window";
import { MDXRemote } from "next-mdx-remote/rsc";
import rehypePrettyCode from "rehype-pretty-code";
interface PageProps {
params: {
@@ -45,7 +46,22 @@ export default async function Post({ params }: PageProps) {
</span>
</div>
<div className="prose lg:prose-xl max-w-none">
<MDXRemote source={postData.content} />
<MDXRemote
source={postData.content}
options={{
mdxOptions: {
rehypePlugins: [
[
rehypePrettyCode,
{
theme: "github-dark-dimmed",
keepBackground: false,
},
],
],
},
}}
/>
</div>
</article>
</Window>