generated from nhcarrigan/template
feat: add syntax highlighting and fix code alignment
This commit is contained in:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user