feat: add rehype-external-links for external link security

This commit is contained in:
2026-06-01 21:31:02 -05:00
parent 0d44f5be6e
commit e1944ec7fd

View File

@@ -58,8 +58,12 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
options={{ options={{
mdxOptions: { mdxOptions: {
remarkPlugins: [smartypants, remarkMath, remarkGfm], remarkPlugins: [smartypants, remarkMath, remarkGfm],
rehypePlugins: [ rehypePlugins: [
rehypeSlug, rehypeSlug,
[rehypeExternalLinks, {
target: '_blank',
rel: ['nofollow', 'noopener', 'noreferrer'],
}],
rehypeAutolinkHeadings, rehypeAutolinkHeadings,
[rehypePrettyCode, { theme: 'github-dark' }], [rehypePrettyCode, { theme: 'github-dark' }],
rehypeKatex, rehypeKatex,