-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
146 lines (145 loc) · 3.73 KB
/
docusaurus.config.js
File metadata and controls
146 lines (145 loc) · 3.73 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
const docConfig = (docId, cfg = {}) => {
return [
"@docusaurus/plugin-content-docs",
{
id: docId,
path: docId,
routeBasePath: docId,
editUrl: "https://github.com/cangSDARM/react-query-web-i18n/blob/master",
sidebarPath: require.resolve(`./${docId}-sidebars.js`),
showLastUpdateTime: true,
sidebarCollapsible: true,
sidebarCollapsed: false,
onlyIncludeVersions: ["current"],
...cfg,
},
];
};
module.exports = {
title: "TanStack Query 中文文档",
url: "https://cangsdarm.github.io",
baseUrl: "/react-query-web-i18n/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
organizationName: "cangsdarm",
favicon: "img/favicon.png",
projectName: "TanStackQueryCN",
i18n: {
defaultLocale: "cn",
locales: ["cn"],
},
ssrTemplate: require("./ssr-template.js").default,
themeConfig: {
colorMode: {
respectPrefersColorScheme: true,
},
// announcementBar: {
// id: "upgrading",
// content: `Vue 文档已同步完成,Solid, Svelte 文档正在翻译中!`,
// backgroundColor: "#272116",
// textColor: "#eee",
// isCloseable: false,
// },
navbar: {
items: [
{
type: "html",
position: "left",
value: `<a class="navbar__brand" style="margin: 0 0 0 -1em;font-size:1.5rem;" href="/react-query-web-i18n/react"><b class="navbar__title text--truncate"><span style="color:#ea910f;">TanStack</span> Query 中文文档</b></a>`,
},
{
label: "框架",
position: "left",
items: [
{
to: "/react",
label: "React",
},
{
to: "/vue",
label: "Vue",
},
{
to: "/solid",
label: "Solid",
},
{
to: "/svelte",
label: "Svelte",
},
],
},
{
type: "search",
position: "right",
},
{
label: "旧版本",
position: "right",
items: [
{
to: "/v3-react",
label: "v3(仅React)",
},
],
},
{
label: "官方资源(英文)",
position: "right",
items: [
{
href: "https://tanstack.com/query/v4/docs/examples/react/basic",
label: "示例",
},
{
href: "https://learn.tanstack.com/p/react-query-essentials",
label: "学习",
},
{
href: "https://github.com/TanStack/query",
label: "Github",
},
],
},
{
href: "https://github.com/cangSDARM/react-query-web-i18n",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [],
copyright: `Copyright © 2021-${new Date().getFullYear()} Web Community.`,
},
algolia: {
appId: "OLBDC9ZFXR",
apiKey: "577ee144fbd9fe01f3825491b25524a0",
indexName: "react-query-web-i18n-react",
debug: false, // Set debug to true if you want to inspect the modal
// Optional: see doc section below
contextualSearch: true,
// Optional: Algolia search parameters
searchParameters: {},
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: docConfig("react")[1],
blog: false,
theme: {
customCss: [require.resolve("./src/css/custom.css")],
},
},
],
],
plugins: [
docConfig("vue"),
docConfig("solid"),
docConfig("svelte"),
docConfig("v3-react"),
],
};