feat: add remark-directive and callout directive transformer

This commit is contained in:
kbot
2026-06-03 21:46:08 -05:00
parent 72443140f9
commit c617ee4438
3 changed files with 52 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import type { NextConfig } from 'next'
import createMDX from '@next/mdx'
const mdxCodeBlockPipeline = new URL('./lib/mdx-hast-visitor.js', import.meta.url).pathname
const calloutDirectivePath = new URL('./lib/callout-directive.js', import.meta.url).pathname
const nextConfig: NextConfig = {
output: 'export',
@@ -11,7 +12,14 @@ const nextConfig: NextConfig = {
const withMDX = createMDX({
options: {
remarkPlugins: ['remark-frontmatter', 'remark-smartypants', 'remark-math', 'remark-gfm'],
remarkPlugins: [
'remark-frontmatter',
'remark-smartypants',
'remark-math',
'remark-gfm',
'remark-directive',
calloutDirectivePath,
],
rehypePlugins: [
'rehype-slug',
['rehype-external-links', { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }],