This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
theme.config.tsx
133 lines (131 loc) · 3.76 KB
/
theme.config.tsx
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
import { DocsThemeConfig } from "nextra-theme-docs";
import { Footer } from "./components/layout/footer";
import Image from "next/image";
import { useRouter } from "next/router";
import { useConfig } from "nextra-theme-docs";
const theme: DocsThemeConfig = {
docsRepositoryBase:
"https://github.com/rooch-network/rooch-network.github.io/blob/main",
nextThemes: {
defaultTheme: "light",
},
logo: (
<div>
<Image
src="/logo/rooch_black_combine.svg"
alt="Rooch Architecture"
width={100}
height={70}
className="dark:hidden"
/>
<Image
src="/logo/rooch_white_combine.svg"
alt="Rooch Architecture"
width={100}
height={70}
className="hidden dark:block"
/>
</div>
),
useNextSeoProps() {
const { asPath } = useRouter();
if (asPath !== "/") {
if (asPath.includes("/docs/")) {
return {
titleTemplate: "%s – Rooch Network Documentation",
};
}
return {
titleTemplate: "%s – Rooch Network",
};
} else {
return {
titleTemplate: "%s",
};
}
},
head: function useHead() {
const { title, frontMatter } = useConfig();
const { asPath } = useRouter();
const router = useRouter();
const socialCard = "/logo/rooch-banner.png";
const currentLang = router.locale;
const pageDescription = frontMatter.description
? frontMatter.description
: currentLang === "en-US"
? "Accelerating World's Transition to Decentralization"
: "加速世界向去中心化的转变";
return (
<>
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="alternate"
href={"https://rooch.network" + asPath}
hrefLang="x-default"
/>
<link
rel="alternate"
href={"https://rooch.network" + asPath}
hrefLang="en-us"
/>
<link
rel="alternate"
href={"https://rooch.network" + asPath}
hrefLang="en"
/>
<link
rel="alternate"
href={"https://rooch.network/zh-CN" + asPath}
hrefLang="zh-cn"
/>
<link
rel="alternate"
href={"https://rooch.network/zh-CN" + asPath}
hrefLang="zh"
/>
<meta name="description" content={pageDescription} />
<meta name="og:description" content={pageDescription} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={socialCard} />
<meta name="twitter:site:domain" content="rooch.network" />
<meta name="twitter:url" content="https://rooch.network" />
<meta name="og:image" content={socialCard} />
<meta name="apple-mobile-web-app-title" content="Rooch Network" />
<link
rel="icon"
href="/logo/rooch_black_logo.svg"
type="image/svg+xml"
/>
<link rel="icon" href="/logo/rooch_black_logo.png" type="image/png" />
<link
rel="icon"
href="/logo/rooch_white_logo.svg"
type="image/svg+xml"
media="(prefers-color-scheme: dark)"
/>
<link
rel="icon"
href="/logo/rooch_white_logo.png"
type="image/png"
media="(prefers-color-scheme: dark)"
/>
</>
);
},
project: {
link: "https://github.com/rooch-network",
},
chat: {
link: "https://discord.gg/rooch",
},
i18n: [
{ locale: "en-US", text: "English" },
{ locale: "zh-CN", text: "简体中文" },
],
footer: {
component: Footer,
},
};
export default theme;