summaryrefslogtreecommitdiff
path: root/examples/with-markdown-plugins/astro.config.mjs
blob: 0fbb40de63b3f96e93e043243153b4a528c32020 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Full Astro Configuration API Documentation:
// https://docs.astro.build/reference/configuration-reference

// @type-check enabled!
// VSCode and other TypeScript-enabled text editors will provide auto-completion,
// helpful tooltips, and warnings if your exported object is invalid.
// You can disable this by removing "@ts-check" and `@type` comments below.
import astroRemark from '@astrojs/markdown-remark';

// @ts-check
export default /** @type {import('astro').AstroUserConfig} */ ({
	// Enable Custom Markdown options, plugins, etc.
	markdownOptions: {
		render: [
			astroRemark,
			{
				remarkPlugins: ['remark-code-titles'],
				rehypePlugins: [
					['rehype-autolink-headings', { behavior: 'prepend' }],
					['rehype-toc', { headings: ['h2', 'h3'] }],
					[new URL('./add-classes.mjs', import.meta.url).pathname, { 'h1,h2,h3': 'title' }],
					'rehype-slug',
				],
			},
		],
	},
});