mdx: add remark-frontmatter to pipeline, fix rehype-pretty-code line numbers visitor

This commit is contained in:
2026-06-02 12:05:32 -05:00
parent bf34a225c0
commit 5ff65968a3
4 changed files with 43 additions and 7 deletions

View File

@@ -9,17 +9,13 @@ const nextConfig: NextConfig = {
const withMDX = createMDX({
options: {
remarkPlugins: ['remark-smartypants', 'remark-math', 'remark-gfm'],
remarkPlugins: ['remark-frontmatter', 'remark-smartypants', 'remark-math', 'remark-gfm'],
rehypePlugins: [
'rehype-slug',
['rehype-external-links', { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }],
'rehype-autolink-headings',
['rehype-pretty-code', {
theme: { light: 'github-light', dark: 'github-dark-dimmed' },
keepBackground: false,
lineNumbers: true,
grid: true,
}],
['rehype-pretty-code', { theme: { light: 'github-light', dark: 'github-dark-dimmed' }, keepBackground: false, grid: true }],
'/mnt/blog/new-blog/lib/mdx-hast-visitor.js',
'rehype-katex',
],
},