forked from withastro/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.ts
52 lines (49 loc) · 1.68 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 { astroCodeSnippets, codeSnippetAutoImport } from './integrations/astro-code-snippets';
import { sitemap } from './integrations/sitemap';
import { autolinkConfig } from './plugins/rehype-autolink-config';
import { rehypei18nAutolinkHeadings } from './plugins/rehype-i18n-autolink-headings';
import { rehypeTasklistEnhancer } from './plugins/rehype-tasklist-enhancer';
import { remarkFallbackLang } from './plugins/remark-fallback-lang';
import { theme } from './syntax-highlighting-theme';
// https://astro.build/config
export default defineConfig({
site: 'https://docs.astro.build/',
integrations: [
AutoImport({
imports: [asideAutoImport, codeSnippetAutoImport],
}),
preact({ compat: true }),
sitemap(),
astroAsides(),
astroCodeSnippets(),
mdx(),
],
markdown: {
syntaxHighlight: 'shiki',
shikiConfig: { theme },
// 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(),
],
},
});