#Using remark/rehype plugins per-layout?

5 messages · Page 1 of 1 (latest)

sacred mountain
#

I've got some remark and rehype plugins set up to automatically add section links to headings. This works great for longform blog content, but I'd also like to author other small pages using Markdown. Is there a way to disable the plugin for pages which don't use my longform layout?

alpine oasis
sacred mountain
alpine oasis
#

Ya, the example is a remark plugin so you can add it to your config like this: ```js
import { defineConfig } from 'astro/config'
import { conditionalRemarkBehead } from '../your/plugin/file';

export default defineConfig({
markdown: {
remarkPlugins: [
conditionalRemarkBehead
]
}
})

sacred mountain
#

Trying this, thanks!