-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy paththeme.config.tsx
202 lines (197 loc) · 6.37 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
import { useTheme } from "nextra-theme-docs";
import { useState, useEffect } from "react";
import { VercelLogo } from "./components/Icons";
import Image from "next/image";
import lightLogotype from "./public/images/logos/lightLogotype.webp";
import darkLogotype from "./public/images/logos/darkLogotype.webp";
import { useRouter } from "next/router";
import { useConfig } from "nextra-theme-docs";
import urlcat from "urlcat";
const useDark = () => {
const { resolvedTheme } = useTheme();
const [isDark, setIsDark] = useState(false);
useEffect(() => {
setIsDark(resolvedTheme === "dark");
return () => {
false;
};
}, [resolvedTheme]);
return isDark;
};
const config = {
primaryHue: 18,
project: {
link: "https://dahliaos.io/github",
},
chat: {
link: "https://dahliaos.io/discord",
},
docsRepositoryBase: "https://github.com/dahliaOS/documentation/blob/main/",
toc: {
extraContent: () => {
return (
<a
className="nx-text-xs nx-font-medium nx-text-gray-500 hover:nx-text-gray-900 dark:nx-text-gray-400 dark:hover:nx-text-gray-100 contrast-more:nx-text-gray-800 contrast-more:dark:nx-text-gray-50"
target="_blank"
href="https://dahliaos.io/donate"
>
Support dahliaOS →
</a>
);
},
float: true,
backToTop: true,
},
feedback: { content: "Question? Give us feedback →", labels: "feedback" },
navigation: { next: true, prev: true },
darkMode: true,
footer: {
text: () => {
return (
<>
<div
style={{ display: "flex", flexDirection: "column", gap: "10px" }}
>
<a
href="https://vercel.com?utm_source=dahliaOS&utm_campaign=oss"
target="_blank"
style={{ display: "flex", flexDirection: "row", gap: "10px" }}
>
Powered By
<VercelLogo />
</a>
<p>© {new Date().getFullYear()} The dahliaOS Project.</p>
</div>
</>
);
},
},
editLink: {
text: "Edit this page on GitHub →",
},
logo: () => {
const isDark = useDark();
return (
<>
<Image
src={isDark ? darkLogotype : lightLogotype}
width="120"
alt="dahliaOS"
style={{ marginRight: "10px" }}
/>
</>
);
},
useNextSeoProps() {
const { route } = useRouter();
if (route !== "/") {
return {
titleTemplate: "%s – dahliaOS Docs",
};
}
return { titleTemplate: "dahliaOS Docs" };
},
head: () => {
const { asPath } = useRouter();
const { route } = useRouter();
const { title, ...meta } = useConfig().frontMatter;
return (
<>
<meta charSet="UTF-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<link rel="canonical" href="https://docs.dahliaos.io" />
<meta property="og:url" content={`https://docs.dahliaos.io${asPath}`} />
<meta name="theme-color" content="#ff3d00" />
<meta property="og:site_name" content="dahliaOS" />
<meta name="og:title" content="dahliaOS Docs" />
<meta httpEquiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
rel="icon"
type="image/png"
href="/images/favicon/favicon-32x32.png"
/>
<meta name="apple-mobile-web-app-status-bar-style" content="#ff3d00" />
<meta name="apple-mobile-web-app-title" content="dahliaOS" />
<meta
name="msapplication-TileImage"
content="/images/favicon/favicon.png"
/>
<meta name="msapplication-TileColor" content="#ff3d00" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/images/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/images/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/images/favicon/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<meta
name="keywords"
content="dahlia, documentation, software, flutter, fuchsia, linux, dahliaOS, computer, operating system, os, system, kernel, dart, open source, material, design, zircon, go, rust"
/>
<meta
property="description"
content={
meta.description ||
"dahliaOS is a modern, secure, lightweight and responsive operating system, combining the best of GNU/Linux and Fuchsia OS. We are developing a privacy-respecting, fast, secure and lightweight operating system, our goal is to establish a new standard for the desktop platform."
}
/>
<meta
property="og:description"
content={
meta.description ||
"dahliaOS is a modern, secure, lightweight and responsive operating system, combining the best of GNU/Linux and Fuchsia OS. We are developing a privacy-respecting, fast, secure and lightweight operating system, our goal is to establish a new standard for the desktop platform."
}
/>
<meta
property="og:image"
content={
meta.image ||
urlcat("https://docs.dahliaos.io/api/og/", {
title,
desc: meta.description ?? undefined,
})
}
/>
<meta
property="twitter:card"
content={meta.image ? "summary_large_image" : "summary"}
/>
<meta property="twitter:site" content="@dahliaos_io" />
{route === "/" ? (
<meta property="twitter:title" content="dahliaOS Docs" />
) : (
<meta property="twitter:title" content={`${title} - dahliaOS Docs`} />
)}
<meta property="twitter:description" content={meta.description} />
<meta
property="twitter:url"
content={`https://docs.dahliaos.io${asPath}`}
/>
<meta
property="twitter:image"
content={
meta.image ||
urlcat("https://docs.dahliaos.io/api/og/", {
title,
desc: meta.description ?? undefined,
})
}
/>
</>
);
},
};
export default config;