Repository navigation
Expand file tree
/
Copy pathrstack.config.ts
More file actions
116 lines (110 loc) · 2.77 KB
/
Copy pathrstack.config.ts
File metadata and controls
116 lines (110 loc) · 2.77 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
import { promises as fs } from "node:fs";
import * as path from "node:path";
import { define } from "rstack";
const SITE_URL = "https://docs.halo.run";
define.doc(async () => {
const [
{ pluginSass },
{ transformerCompatibleMetaHighlight },
{ default: fileTree },
{ default: ga },
{ default: mermaid },
{ default: Icons },
] = await Promise.all([
import("@rsbuild/plugin-sass"),
import("@rspress/core/shiki-transformers"),
import("rspress-plugin-file-tree"),
import("rspress-plugin-google-analytics"),
import("rspress-plugin-mermaid"),
import("unplugin-icons/rspack"),
]);
return {
root: path.join(import.meta.dirname, "docs"),
themeDir: path.join(import.meta.dirname, "theme"),
lang: "zh",
title: "Halo 文档",
logoText: "Halo 文档",
icon: "/img/favicon-96x96.png",
logo: "https://www.halo.run/logo",
siteOrigin: SITE_URL,
globalStyles: path.join(import.meta.dirname, "styles/index.scss"),
mediumZoom: {
selector: ".rspress-doc img:not(.no-zoom)",
},
markdown: {
showLineNumbers: true,
link: {
checkDeadLinks: true,
},
shiki: {
theme: "github-dark",
transformers: [transformerCompatibleMetaHighlight()],
},
image: {
checkDeadImages: true,
},
},
outDir: "build",
plugins: [
mermaid(),
ga({
id: "UA-110780416-7",
}),
fileTree(),
],
builderConfig: {
plugins: [pluginSass()],
html: {
tags: [
{
tag: "script",
attrs: {
src: "https://track.halo.run/api/script.js",
defer: true,
"data-site-id": "3",
},
},
],
},
tools: {
rspack: {
plugins: [
Icons({
compiler: "jsx",
jsx: "react",
customCollections: {
custom: {
"bt-panel": () =>
fs.readFile("./theme/images/bt-panel-logo.svg", "utf-8"),
},
},
}),
],
},
},
},
themeConfig: {
lastUpdated: true,
enableScrollToTop: true,
editLink: {
docRepoBaseUrl: "https://github.com/halo-dev/docs/tree/main/docs",
},
socialLinks: [
{
icon: "github",
mode: "link",
content: "https://github.com/halo-dev/halo",
},
],
},
};
});
define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]);
define.fmt({
singleQuote: false,
ignorePatterns: [".agents"],
});
define.staged({
"*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}": ["rs lint --fix", "rs fmt"],
"*.{json,jsonc,md,mdx,css,scss,less,html,yml,yaml}": "rs fmt",
});