forked from cworld1/astro-theme-pure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
115 lines (107 loc) · 2.51 KB
/
astro.config.mjs
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// @ts-check
import { defineConfig } from 'astro/config'
// Adapter
// 1. Vercel (serverless)
import vercelServerless from '@astrojs/vercel/serverless'
// 2. Vercel (static)
// import vercelStatic from '@astrojs/vercel/static';
// 3. Local (standalone)
// import node from '@astrojs/node'
// ---
// Integrations
import mdx from '@astrojs/mdx'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import icon from 'astro-icon'
// Markdown
import {
remarkReadingTime,
remarkAddZoomable,
remarkGithubCards,
remarkArxivCards
} from './src/plugins/remarkPlugins.ts'
import rehypeExternalLinks from 'rehype-external-links'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import { siteConfig } from './src/site.config.ts'
import {
addCopyButton,
addTitle,
addLanguage,
updateStyle,
transformerNotationDiff
} from './src/plugins/shikiTransformers.ts'
// https://astro.build/config
export default defineConfig({
// Top-Level Options
site: siteConfig.site,
// base: '/docs',
trailingSlash: 'never',
output: 'server',
// Adapter
// 1. Vercel (serverless)
adapter: vercelServerless(),
// 2. Vercel (static)
// adapter: vercelStatic(),
// 3. Local (standalone)
// adapter: node({ mode: 'standalone' }),
// ---
image: {
service: {
entrypoint: 'astro/assets/services/sharp'
}
},
integrations: [
tailwind({ applyBaseStyles: false }),
sitemap(),
mdx(),
icon(),
(await import('@playform/compress')).default({
SVG: false,
Exclude: ['index.*.js']
})
],
// root: './my-project-directory',
// Prefetch Options
prefetch: true,
// Server Options
server: {
host: true
},
// Markdown Options
markdown: {
remarkPlugins: [
remarkReadingTime,
remarkAddZoomable,
remarkMath,
remarkGithubCards,
remarkArxivCards
],
rehypePlugins: [
[rehypeKatex, {}],
[
rehypeExternalLinks,
{
...(siteConfig.content.externalLinkArrow && { content: { type: 'text', value: ' ↗' } }),
target: '_blank',
rel: ['nofollow, noopener, noreferrer']
}
]
],
// remarkRehype: { },
// https://docs.astro.build/en/guides/syntax-highlighting/
shikiConfig: {
themes: {
light: 'github-light',
dark: 'github-dark'
},
transformers: [
transformerNotationDiff(),
updateStyle(),
addTitle(),
addLanguage(),
addCopyButton(2000)
]
}
}
})