-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
124 lines (110 loc) · 2.82 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
116
117
118
119
120
121
122
123
124
// @ts-check
import cloudflare from '@astrojs/cloudflare'
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
// Adapter
// import vercel from '@astrojs/vercel'
// Integrations
import icon from 'astro-icon'
import AstroPureIntegration from 'astro-pure'
import { defineConfig } from 'astro/config'
// Rehype & remark packages
import rehypeKatex from 'rehype-katex'
import remarkMath from 'remark-math'
// import { visualizer } from 'rollup-plugin-visualizer'
// import { pagefindConfig } from './src/plugins/pagefind.ts'
// Local rehype & remark plugins
import rehypeAutolinkHeadings from './src/plugins/rehypeAutolinkHeadings.ts'
// Markdown
import { remarkArxivCards, remarkReadingTime } from './src/plugins/remarkPlugins.ts'
// Shiki
import {
addCopyButton,
addLanguage,
addTitle,
transformerNotationDiff,
transformerNotationHighlight,
updateStyle
} from './src/plugins/shikiTransformers.ts'
import config from './src/site.config.ts'
import sitemap from '@astrojs/sitemap';
// https://astro.build/config
export default defineConfig({
// Top-Level Options
site: 'https://blog.imnya.ng',
base: '/',
trailingSlash: 'never',
// Adapter
// 1. Vercel (serverless)
// adapter: vercel(),
output: 'server',
// 2. Vercel (static)
// adapter: vercelStatic(),
// 3. Local (standalone)
// adapter: node({ mode: 'standalone' }),
// ---
image: {
service: {
entrypoint: 'astro/assets/services/sharp'
}
},
integrations: [icon(), // astro-pure will automatically add sitemap, mdx & tailwind
// sitemap(),
// mdx(),
// tailwind({ applyBaseStyles: false }),
// (await import('@playform/compress')).default({
// SVG: false,
// Exclude: ['index.*.js']
// }),
// pagefindConfig()
AstroPureIntegration(config), sitemap()],
// root: './my-project-directory',
// Prefetch Options
prefetch: true,
// Server Options
server: {
host: true
},
// Markdown Options
markdown: {
remarkPlugins: [remarkReadingTime, remarkMath, remarkArxivCards],
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)
]
}
},
// vite: {
// plugins: [
// visualizer({
// emitFile: true,
// filename: 'stats.html'
// })
// ]
// }
experimental: {
svg: true
},
adapter: cloudflare()
})