-
Notifications
You must be signed in to change notification settings - Fork 19
/
theme.config.tsx
88 lines (85 loc) · 2.15 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
import { clsx } from "clsx";
import { useRouter } from "next/router";
import { DocsThemeConfig } from "nextra-theme-docs";
import { Footer } from "@/components/Footer";
import { Head } from "@/components/Head";
import { SidebarTitleComponent } from "@/components/SidebarTitleComponent";
import { ThemeToggle } from "@/components/ThemeToggle";
import { Toc } from "@/components/Toc";
import { InkLogo } from "@/icons/InkLogo";
import { URLS } from "@/utils/urls";
const config: DocsThemeConfig = {
logo: <InkLogo />,
darkMode: false,
project: {
link: URLS.githubOrgUrl,
},
chat: {
link: "https://discord.gg/inkonchain",
},
docsRepositoryBase: URLS.repositoryUrl,
head: Head,
components: {
a(props: { href?: string }) {
const isExternal = props.href?.startsWith("http");
return (
<a
{...props}
{...(isExternal
? { target: "_blank", rel: "noopener noreferrer" }
: {})}
className="text-magic-purple underline decoration-1 transition-all hover:text-magic-purple/80 dark:text-magic-soft-pink dark:hover:text-magic-soft-pink/80"
/>
);
},
code(props) {
return (
<code
{...props}
className={clsx(
"bg-magic-semi-deep-purple/15 text-magic-purple dark:text-magic-white text-sm rounded-md px-2 py-0.5"
)}
/>
);
},
},
sidebar: {
defaultMenuCollapseLevel: 1,
autoCollapse: true,
titleComponent: SidebarTitleComponent,
},
navbar: {
extraContent: ThemeToggle,
},
footer: {
component: Footer,
},
toc: {
backToTop: true,
component: Toc,
},
banner: {
key: "docs-wip",
text: (
<a
className="!text-white hover:!text-white/80"
href="/"
target="_blank"
rel="noopener noreferrer"
aria-label="Documentation Status"
>
🎉 Mainnet is LIVE! 🎉
</a>
),
},
useNextSeoProps() {
const { asPath } = useRouter();
return {
titleTemplate:
asPath === "/"
? "Ink Docs - The Official Developer Guide for Ink"
: "%s | Ink Docs",
};
},
};
export default config;