-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathastro.config.mjs
57 lines (50 loc) · 1.54 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
import fs from 'node:fs';
import svelte from '@astrojs/svelte';
import tailwind from '@astrojs/tailwind';
import expressiveCode, { ExpressiveCodeTheme } from 'astro-expressive-code';
import { defineConfig } from 'astro/config';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import mdx from '@astrojs/mdx';
import { pluginErrorPreview } from './src/plugins/error-preview-plugin';
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';
import vercel from '@astrojs/vercel';
const catppuccinJsoncString = fs.readFileSync(
new URL('./theme.jsonc', import.meta.url),
'utf-8',
);
const catppuccin = ExpressiveCodeTheme.fromJSONString(catppuccinJsoncString);
const synthwaveJsoncString = fs.readFileSync(
new URL('./theme2.jsonc', import.meta.url),
'utf-8',
);
const synthwave = ExpressiveCodeTheme.fromJSONString(synthwaveJsoncString);
// https://astro.build/config
export default defineConfig({
prefetch: {
prefetchAll: true
},
redirects: {
'/blog/': '/posts/1',
},
integrations: [
tailwind(),
expressiveCode({
plugins: [pluginErrorPreview()],
themes: [catppuccin, synthwave],
themeCssRoot: 'html',
themeCssSelector: (theme) => `[data-theme=${theme.name}]`,
useDarkModeMediaQuery: true,
}),
svelte(),
mdx(),
],
markdown: {
remarkPlugins: [remarkReadingTime],
rehypePlugins: [
rehypeHeadingIds,
[rehypeAutolinkHeadings, { behavior: 'wrap' }],
],
},
adapter: vercel(),
});