Skip to content

Commit

Permalink
fix: don't autolink on blog
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Nov 26, 2023
1 parent b2eb71b commit de78013
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/components/mdx/Div.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { clsx } from 'clsx'
import { type DetailedHTMLProps, type HTMLAttributes } from 'react'

import { usePageData } from '../../hooks/usePageData.js'
import { Authors } from '../Authors.js'
import { BlogPosts } from '../BlogPosts.js'
import { AutolinkIcon } from './AutolinkIcon.js'
Expand All @@ -12,12 +13,16 @@ import { Steps } from './Steps.js'
import { Subtitle } from './Subtitle.js'

export function Div(props: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>) {
const { frontmatter } = usePageData()
const { layout } = frontmatter || {}

const className = clsx(props.className, styles.root)

if (props.className === 'code-group')
return <CodeGroup {...(props as any)} className={className} />
if ('data-authors' in props) return <Authors />
if ('data-blog-posts' in props) return <BlogPosts />
if ('data-autolink-icon' in props)
if ('data-autolink-icon' in props && layout !== 'blog')
return <AutolinkIcon {...(props as any)} className={className} />
if ('data-rehype-pretty-code-title' in props)
return <CodeTitle {...(props as any)} className={className} />
Expand Down

0 comments on commit de78013

Please sign in to comment.