forked from withastro/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.ts
52 lines (49 loc) · 1.69 KB
/
astro.config.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import mdx from '@astrojs/mdx';
import preact from '@astrojs/preact';
import { defineConfig } from 'astro/config';
import AutoImport from 'astro-auto-import';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import remarkSmartypants from 'remark-smartypants';
import { asideAutoImport, astroAsides } from './integrations/astro-asides';
import { astroDocsExpressiveCode } from './integrations/expressive-code';
import { sitemap } from './integrations/sitemap';
import { autolinkConfig } from './plugins/rehype-autolink-config';
import { rehypei18nAutolinkHeadings } from './plugins/rehype-i18n-autolink-headings';
import { rehypeOptimizeStatic } from './plugins/rehype-optimize-static';
import { rehypeTasklistEnhancer } from './plugins/rehype-tasklist-enhancer';
import { remarkFallbackLang } from './plugins/remark-fallback-lang';
// https://astro.build/config
export default defineConfig({
site: 'https://docs.astro.build/',
integrations: [
AutoImport({
imports: [asideAutoImport],
}),
preact({ compat: true }),
sitemap(),
astroAsides(),
astroDocsExpressiveCode(),
mdx(),
],
markdown: {
// Override with our own config
smartypants: false,
remarkPlugins: [
[remarkSmartypants, { dashes: false }],
// Add our custom plugin that marks links to fallback language pages
remarkFallbackLang(),
],
rehypePlugins: [
rehypeSlug,
// This adds links to headings
[rehypeAutolinkHeadings, autolinkConfig],
// Tweak GFM task list syntax
rehypeTasklistEnhancer(),
// Translates the autolink headings anchors
rehypei18nAutolinkHeadings(),
// Collapse static parts of the hast to html
rehypeOptimizeStatic,
],
},
});