-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrspress.config.ts
More file actions
123 lines (122 loc) · 3.2 KB
/
rspress.config.ts
File metadata and controls
123 lines (122 loc) · 3.2 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
117
118
119
120
121
122
123
import * as path from 'node:path';
import { pluginPreview } from '@rspress/plugin-preview';
import mermaid from 'rspress-plugin-mermaid';
import { defineConfig } from 'rspress/config';
import { algoliaConfig } from './config/algolia.config';
export default defineConfig({
root: path.join(__dirname, 'docs'),
plugins: [
// biome-ignore lint/suspicious/noExplicitAny: mermaid 插件使用旧版本的 @rspress/shared,需要类型断言
mermaid() as any,
pluginPreview({
iframeOptions: {
devPort: 7777,
position: 'follow',
},
previewMode: 'iframe',
defaultRenderMode: 'pure',
}),
],
logo: {
light: '/tachybase-light-blue.png',
dark: '/tachybase-dark-white.png',
},
// favicon 已在 builderConfig.html.tags 中配置
themeConfig: {
lastUpdated: true,
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/tachybase/tachybase',
},
],
search: false, // 使用自定义 Algolia DocSearch 组件
locales: [
{
lang: 'en',
label: 'dd',
outlineTitle: 'ON THIS Page',
editLink: {
docRepoBaseUrl: 'https://github.com/tegojs/docs/tree/main/docs',
text: '📝 Edit this page on GitHub',
},
searchPlaceholderText: 'Type keywords to search...',
searchNoResultsText: 'No results found',
searchSuggestedQueryText: 'Please try again with a different keyword',
},
{
lang: 'zh',
label: 'dd',
outlineTitle: '大纲',
editLink: {
docRepoBaseUrl: 'https://github.com/tegojs/docs/tree/main/docs',
text: '📝 在 GitHub 上编辑此页',
},
searchPlaceholderText: '输入关键词搜索...',
searchNoResultsText: '未找到结果',
searchSuggestedQueryText: '请尝试使用不同的关键词',
},
],
},
lang: 'zh',
locales: [
{
lang: 'en',
// 导航栏切换语言的标签
label: 'English',
title: 'Rspress',
description: 'Static Site Generator',
},
{
lang: 'zh',
label: '简体中文',
title: 'Rspress',
description: '静态网站生成器',
},
],
globalStyles: '/styles/index.css',
builderConfig: {
html: {
tags: [
{
tag: 'link',
attrs: {
rel: 'icon',
type: 'image/png',
href: '/tachybase-icon-light.png',
},
},
{
tag: 'script',
attrs: {
src: 'https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js',
async: true,
},
},
{
tag: 'link',
attrs: {
rel: 'preconnect',
href: `https://${algoliaConfig.appId}-dsn.algolia.net`,
crossorigin: '',
},
},
{
tag: 'link',
attrs: {
rel: 'dns-prefetch',
href: `https://${algoliaConfig.appId}-dsn.algolia.net`,
},
},
{
tag: 'meta',
attrs: {
name: 'algolia-site-verification',
content: 'D198F62CCC517EC9',
},
},
],
},
},
});