-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
145 lines (136 loc) · 3.02 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import db from '@astrojs/db'
import mdx from '@astrojs/mdx'
import netlify from '@astrojs/netlify'
import partytown from '@astrojs/partytown'
import react from '@astrojs/react'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import playformCompress from '@playform/compress'
import {
transformerMetaHighlight,
transformerMetaWordHighlight,
transformerNotationDiff,
transformerNotationErrorLevel,
transformerNotationFocus,
transformerNotationHighlight,
transformerNotationWordHighlight,
} from '@shikijs/transformers'
import icon from 'astro-icon'
import {
defineConfig,
} from 'astro/config'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeExternalLinks from 'rehype-external-links'
import rehypeSlug from 'rehype-slug'
import { schema } from './env.schema'
/**
* https://astro.build/config
*/
export default defineConfig({
site: 'http://localhost:4321/',
integrations: [
db(),
tailwind({
applyBaseStyles: false,
}),
mdx(),
/**
* https://docs.astro.build/zh-cn/guides/integrations-guide/sitemap
*/
sitemap(),
react(),
icon({
include: {
'lucide': [
'laptop',
'settings',
'search',
],
'simple-icons': ['github', 'x', 'bluesky'],
},
}),
partytown({
config: {
debug: true,
forward: ['dataLayer.push'],
},
}),
playformCompress({
HTML: true,
Image: true,
JavaScript: true,
SVG: true,
}),
],
devToolbar: {
enabled: false,
},
markdown: {
shikiConfig: {
themes: {
light: 'github-light-default',
dark: 'github-dark-default',
},
transformers: [
transformerNotationDiff(),
transformerNotationHighlight(),
transformerNotationWordHighlight(),
transformerNotationFocus(),
transformerNotationErrorLevel(),
transformerMetaHighlight(),
transformerMetaWordHighlight(),
{
pre(node) {
node.properties.__rawString__ = this.source
},
},
],
},
rehypePlugins: [
rehypeSlug,
// rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: 'prepend',
properties: {
className: ['subheading-anchor'],
ariaLabel: 'Link to section',
ariaHidden: 'true',
},
},
],
[
rehypeExternalLinks,
{
target: '_blank',
rel: ['nofollow', 'noreferrer', 'noopener'],
properties: {
className: ['link'],
},
content: { type: 'text', value: ' ↗' },
},
],
],
},
image: {
remotePatterns: [{
protocol: 'https',
}],
},
experimental: {
contentIntellisense: true,
responsiveImages: true,
svg: true,
},
vite: {
optimizeDeps: {
include: ['lucide-react'],
},
},
env: {
schema,
validateSecrets: false,
},
adapter: netlify(),
})