#Overwrite md heading with astro component

7 messages · Page 1 of 1 (latest)

rough sluice
#

How can I overwrite all headings in markdown files so I would have each heading modified with copy to clipboard button addition?

stable moat
rough sluice
#

hmm I tried adding it for a while

import { defineConfig } from 'astro/config'
import preact from '@astrojs/preact'
import react from '@astrojs/react'
import mdx from '@astrojs/mdx'
import compress from 'astro-compress'

import sitemap from '@astrojs/sitemap'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'

// https://astro.build/config
export default defineConfig({
    markdown: {
        rehypePlugins: [rehypeAutolinkHeadings],
    },
    integrations: [preact(), react(), mdx(), compress(), sitemap()],
    site: `https://bewebdev.tech/`,
})
#

It doesn't seem to add anything to the DOM

#

when I try adding smth like this

rehypePlugins: [rehypeAutolinkHeadings({ behavior: 'after' })],
#

I get this error