-
Notifications
You must be signed in to change notification settings - Fork 12
/
theme.config.js
96 lines (93 loc) · 2.43 KB
/
theme.config.js
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
import { useState, useEffect } from "react";
import { useTheme } from "next-themes";
import Navigation from "./components/Navigation";
import { Github, Discord, Twitter } from "./components/Social";
const useDark = () => {
const { resolvedTheme } = useTheme();
const [isDark, setIsDark] = useState(false);
useEffect(() => {
setIsDark(resolvedTheme === "dark");
return () => false;
}, [resolvedTheme]);
return isDark;
};
/** @type import('nextra-theme-docs').DocsThemeConfig */
const theme = {
docsRepositoryBase: "https://github.com/context-labs/kuzco-docs/tree/main",
editLink: {
text: "Edit this page on GitHub",
},
feedback: {
content: "Question? Give us feedback →",
},
toc: {
float: true,
},
logo: function Logo() {
const isDark = useDark();
return (
<>
<img
width="24"
src={`/logo${isDark ? "-dark" : ""}.svg`}
alt="Kuzco Logo"
/>
<span className="w-full font-bold pl-2">Kuzco Documentation</span>
</>
);
},
useNextSeoProps: () => ({
titleTemplate: `%s | Kuzco Documentation`,
openGraph: {
type: "website",
locale: "en_IE",
url: "https://kuzco.xyz",
siteName: "Kuzco Documentation",
description: "LLM inference network built on Solana",
images: [
{
url: "https://kuzco.xyz/opengraph.png",
alt: "Kuzco Image",
width: 800,
height: 600,
},
],
},
twitter: {
handle: "@kuzco_xyz",
site: "@kuzco_xyz",
cardType: "summary_large_image",
},
}),
gitTimestamp({ timestamp }) {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [dateString, setDateString] = useState(timestamp.toISOString());
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
try {
setDateString(
timestamp.toLocaleDateString(navigator.language, {
day: "numeric",
month: "long",
year: "numeric",
})
);
} catch (e) {
// Ignore errors here; they get the ISO string.
// At least one person out there has manually misconfigured navigator.language.
}
}, [timestamp]);
return <>Last updated on {dateString}</>;
},
navbar: {
component: <Navigation />,
extraContent: (
<>
<Github />
<Discord />
<Twitter />
</>
),
},
};
export default theme;