-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.ts
More file actions
113 lines (111 loc) · 3.73 KB
/
Copy pathastro.config.ts
File metadata and controls
113 lines (111 loc) · 3.73 KB
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
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
import vercel from '@astrojs/vercel'
import AstroPureIntegration from 'astro-pure'
import { defineConfig, fontProviders } from 'astro/config'
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
import remotePatter from './public/remotePatter.json'
// Local integrations
import rehypeAutolinkHeadings from './src/plugins/rehype-auto-link-headings.ts'
import {
addCollapse,
addCopyButton,
addLanguage,
addTitle,
updateStyle
} from './src/plugins/shiki-custom-transformers.ts'
import {
transformerNotationDiff,
transformerNotationHighlight,
transformerRemoveNotationEscape
} from './src/plugins/shiki-offical/transformers.ts'
import config from './src/site.config.ts'
// https://astro.build/config
export default defineConfig({
site: 'https://santisify.top',
trailingSlash: 'never',
adapter: vercel({
// devImageService: 'sharp',
imageService: true
}),
output: 'server',
image: {
responsiveStyles: true,
service: { entrypoint: 'astro/assets/services/sharp' },
remotePatterns: remotePatter
},
integrations: [AstroPureIntegration(config)],
prefetch: true,
server: {
host: true
},
markdown: {
remarkPlugins: [remarkMath],
rehypePlugins: [
[rehypeKatex, {}],
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: 'append',
properties: { className: ['anchor'] },
content: { type: 'text', value: '#' }
}
]
],
// https://docs.astro.build/en/guides/syntax-highlighting/
shikiConfig: {
themes: {
light: 'github-light',
dark: 'github-dark'
},
transformers: [
// Two copies of @shikijs/types (one under node_modules
// and another nested under @astrojs/markdown-remark → shiki).
// Official transformers
// @ts-ignore this happens due to multiple versions of shiki types
transformerNotationDiff(),
// @ts-ignore this happens due to multiple versions of shiki types
transformerNotationHighlight(),
// @ts-ignore this happens due to multiple versions of shiki types
transformerRemoveNotationEscape(),
// Custom transformers
// @ts-ignore this happens due to multiple versions of shiki types
updateStyle(),
// @ts-ignore this happens due to multiple versions of shiki types
addTitle(),
// @ts-ignore this happens due to multiple versions of shiki types
addLanguage(),
// @ts-ignore this happens due to multiple versions of shiki types
addCopyButton(2000), // timeout in ms
// @ts-ignore this happens due to multiple versions of shiki types
addCollapse(15) // max lines that needs to collapse
]
}
},
experimental: {
// Allow compatible editors to support intellisense features for content collection entries
// https://docs.astro.build/en/reference/experimental-flags/content-intellisense/
contentIntellisense: true,
// Enable SVGO optimization for SVG assets
// https://docs.astro.build/en/reference/experimental-flags/svg-optimization/
svgo: true,
// Enable font preloading and optimization
// https://docs.astro.build/en/reference/experimental-flags/fonts/
fonts: [
{
provider: fontProviders.fontshare(),
name: 'Satoshi',
cssVariable: '--font-satoshi',
// Default included:
// weights: [400],
// styles: ["normal", "italics"],
// subsets: ["cyrillic-ext", "cyrillic", "greek-ext", "greek", "vietnamese", "latin-ext", "latin"],
// fallbacks: ["sans-serif"],
styles: ['normal', 'italic'],
weights: [400, 500],
subsets: ['latin']
}
]
}
})