feat: add rehype-slug for TableOfContents heading IDs

This commit is contained in:
2026-06-01 21:22:49 -05:00
parent 6dc42c1ba8
commit d679b804fc
3 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import remarkMath from 'remark-math'
import remarkGfm from 'remark-gfm'
import rehypePrettyCode from 'rehype-pretty-code'
import rehypeKatex from 'rehype-katex'
import rehypeSlug from 'rehype-slug'
import { getPosts, getPost, getReadingTime } from '@/lib/posts'
import { TableOfContents } from '@/components/blog/TableOfContents'
import { ScrollToTop } from '@/components/ui/ScrollToTop'
@@ -55,6 +56,7 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
mdxOptions: {
remarkPlugins: [remarkMath, remarkGfm],
rehypePlugins: [
rehypeSlug,
[rehypePrettyCode, { theme: 'github-dark' }],
rehypeKatex,
],