#Help with adding ## to markdown headings

9 messages · Page 1 of 1 (latest)

upbeat pawn
#

Okay so I want to add like the ## headings that most docs have that copies the link to their slug ID. Is there anyway I can do that in astro?

shell tinsel
#

As far as I know you can pass a custom component to each html tag in <Content /> as props

upbeat pawn
#

Oh cool!

#

Thanks

#

Will try this

thick comet
#

You can also just use remark-auto-links

golden flume
#

You can use the rehype-autolink-headings plugin to automatically add links to your markdown headings: ```js
import remarkToc from 'remark-toc';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';

export default {
markdown: {
rehypePlugins: [
rehypeHeadingIds,
[rehypeAutolinkHeadings, { behavior: 'append' }],
],
},
}

upbeat pawn
#

Yeah I figured it out 😄