forked from yuhangch/astro-theme-panda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
61 lines (56 loc) · 1.75 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
import {defineConfig} from 'astro/config'
import sitemap from '@astrojs/sitemap'
import yaml from '@rollup/plugin-yaml'
import mdx from '@astrojs/mdx'
import partytown from '@astrojs/partytown'
import {remarkModifiedTime} from './src/plugins/remark-modified-time.mjs'
import remarkPanGu from 'remark-pangu'
import UnoCSS from 'unocss/astro'
import expressiveCode from 'astro-expressive-code'
import {ExpressiveCodeTheme} from '@expressive-code/core'
import {readFileSync} from 'fs'
import {parse} from 'jsonc-parser'
import remarkDirective from "remark-directive";
import {RDNotePlugin, RDBilibiliPlugin} from "./src/plugins/remark-directive.mjs";
import {PandaConfig} from "./src/config.js";
const nightOwlDark = new ExpressiveCodeTheme(
parse(readFileSync('./src/styles/expressive-code/night-owl-dark.jsonc', 'utf-8'))
)
const nightOwlLight = new ExpressiveCodeTheme(
parse(readFileSync('./src/styles/expressive-code/night-owl-light.jsonc', 'utf-8'))
)
const {site, base} = PandaConfig
// https://astro.build/config
export default defineConfig({
vite: {
plugins: [yaml()],
},
prefetch: true,
site,
base,
scopedStyleStrategy: 'class',
trailingSlash: 'always',
build: {
format: 'directory'
},
markdown: {
syntaxHighlight: false,
remarkPlugins: [remarkDirective, RDNotePlugin, RDBilibiliPlugin, remarkModifiedTime, remarkPanGu],
remarkRehype: {
footnoteLabel: ' '
}
},
integrations: [
UnoCSS(),
sitemap(),
expressiveCode({
themes: [nightOwlDark, nightOwlLight],
themeCssSelector: (theme) => {
return '.' + theme.type
}
}),
mdx(),
partytown()
],
output: 'static',
})