forked from portone-io/developers.portone.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.ts
50 lines (47 loc) · 1.15 KB
/
astro.config.ts
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
import * as path from "node:path";
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
import solid from "@astrojs/solid-js";
import mdx from "@astrojs/mdx";
import unocss from "unocss/astro";
import yaml from "@rollup/plugin-yaml";
import rehypePrettyCode, {
Options as PrettyCodeOptions,
} from "rehype-pretty-code";
import contentIndex from "./src/content-index";
const prettyCodeOptions: Partial<PrettyCodeOptions> = {
theme: "material-theme-lighter",
onVisitLine(node) {
if (node.children.length === 0) {
node.children = [{ type: "text", value: " " }];
}
},
onVisitHighlightedLine(node) {
node.properties.className.push("highlighted");
},
onVisitHighlightedWord(node) {
node.properties.className = ["word"];
},
tokensMap: {},
};
export default defineConfig({
integrations: [
preact({ compat: true }),
solid(),
mdx(),
unocss(),
contentIndex,
],
vite: {
resolve: {
alias: {
"~": path.resolve("./src/"),
},
},
plugins: [yaml()],
},
markdown: {
syntaxHighlight: false,
rehypePlugins: [[rehypePrettyCode, prettyCodeOptions]],
},
});