-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathastro.config.js
58 lines (57 loc) · 1.8 KB
/
astro.config.js
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
53
54
55
56
57
58
import { defineConfig } from 'astro/config'
import { remarkReadingTime } from './src/plugins/remarkReadingTime'
import { rehypeCodeBlock } from './src/plugins/rehypeCodeBlock'
import { rehypeTableBlock } from './src/plugins/rehypeTableBlock'
import { rehypeCodeHighlight } from './src/plugins/rehypeCodeHighlight'
import { rehypeImage } from './src/plugins/rehypeImage'
import { rehypeLink } from './src/plugins/rehypeLink'
import { rehypeHeading } from './src/plugins/rehypeHeading'
import remarkDirective from 'remark-directive'
import { remarkSpoiler } from './src/plugins/remarkSpoiler'
import { remarkEmbed } from './src/plugins/remarkEmbed'
import tailwind from '@astrojs/tailwind'
import react from '@astrojs/react'
import sitemap from '@astrojs/sitemap'
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
import { site } from './src/config.json'
import remarkMath from 'remark-math'
import rehypeKatex from 'rehype-katex'
import swup from '@swup/astro'
// https://astro.build/config
export default defineConfig({
site: site.url,
integrations: [
tailwind(),
react(),
sitemap(),
swup({
theme: false,
animationClass: 'swup-transition-',
containers: ['main'],
morph: ['[component-export="Provider"]'],
}),
],
markdown: {
syntaxHighlight: false,
smartypants: false,
remarkPlugins: [remarkMath, remarkDirective, remarkEmbed, remarkSpoiler, remarkReadingTime],
rehypePlugins: [
rehypeHeadingIds,
rehypeKatex,
rehypeLink,
rehypeImage,
rehypeHeading,
rehypeCodeBlock,
rehypeCodeHighlight,
rehypeTableBlock,
],
remarkRehype: { footnoteLabel: '参考', footnoteBackLabel: '返回正文' },
},
vite: {
build: {
rollupOptions: {
external: ['/pagefind/pagefind.js'],
},
},
},
})