-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathastro.config.mjs
More file actions
163 lines (153 loc) · 3.96 KB
/
astro.config.mjs
File metadata and controls
163 lines (153 loc) · 3.96 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
// import vercel from '@astrojs/vercel';
import remarkWikiLink from "@braindb/remark-wiki-link";
import expressiveCode from 'astro-expressive-code';
import icon from 'astro-icon';
import { defineConfig } from 'astro/config';
// Others
import rehypeKatex from 'rehype-katex';
import remarkBreaks from 'remark-breaks';
import remarkMath from 'remark-math';
import AstroPureIntegration from './packages/pure/index.ts';
// Local integrations
import { fontSubsetting } from './src/integrations/font-subsetting.ts';
// Local rehype & remark plugins
import rehypeAutolinkHeadings from './src/plugins/rehype-auto-link-headings.ts';
// Shiki
// import { addCopyButton, addLanguage, addTitle, transformerNotationDiff, transformerNotationHighlight, updateStyle } from './src/plugins/shiki-transformers.ts';
import config from './src/site.config.ts';
import react from '@astrojs/react';
// https://astro.build/config
export default defineConfig({
// Top-Level Options
site: 'https://8cat.life',
// base: '/docs',
trailingSlash: 'never',
build: {
format: 'file',
inlineStylesheets: 'auto'
},
// Adapter
// https://docs.astro.build/en/guides/deploy/
// 1. Vercel (serverless)
// adapter: vercel(),
// output: 'server',
// 2. Vercel (static)
// adapter: vercelStatic(),
// 3. Local (standalone)
// adapter: node({ mode: 'standalone' }),
// output: 'server',
// ---
// adapter: undefined,
output: 'static',
// outDir: 'dist',
image: {
service: {
entrypoint: 'astro/assets/services/sharp'
}
},
integrations: [
expressiveCode(),
icon({
include: {
devicon: ['*'],
mingcute: ['*']
}
}),
AstroPureIntegration(config),
fontSubsetting(),
react()
],
// root: './my-project-directory',
// Prefetch Options
prefetch: true,
// Markdown Options
markdown: {
remarkPlugins: [
remarkMath,
[
remarkWikiLink,
{
linkTemplate: ({ slug, alias }) => {
let normalizedSlug = (slug || '')
.replace(/^\/\//, '')
.replace(/^src\/content\//, '')
.replace(/^\/+/, '')
.replace(/\.(md|mdx)$/, '')
.replace(/\/index$/, '')
return {
hName: 'a',
hProperties: {
href: `/${normalizedSlug}`,
class: 'inner-link not-prose'
},
hChildren: [
{
type: 'text',
value: alias || normalizedSlug || ''
}
]
}
}
}
],
remarkBreaks
],
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: [
// transformerNotationDiff(),
// transformerNotationHighlight(),
// updateStyle(),
// addTitle(),
// addLanguage(),
// addCopyButton(2000)
// ]
// }
},
experimental: {
contentIntellisense: true
},
vite: {
ssr: {
noExternal: ['@excalidraw/excalidraw', 'roughjs', 'clsx'],
},
resolve: {
alias: {
'roughjs/bin/rough': 'roughjs/bin/rough.js',
},
},
optimizeDeps: {
include: ['@excalidraw/excalidraw', 'roughjs', 'clsx'],
},
plugins: [
// visualizer({
// emitFile: true,
// filename: 'stats.html'
// })
],
server: {
host: true
// https: {
// key: fs.readFileSync('./localhost+2-key.pem'),
// cert: fs.readFileSync('./localhost+2.pem')
// }
}
}
})