-
Notifications
You must be signed in to change notification settings - Fork 11
/
theme.config.tsx
128 lines (124 loc) · 3.75 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
import React from 'react'
import type { DocsThemeConfig } from 'nextra-theme-docs'
import { useConfig } from 'nextra-theme-docs'
import { useRouter } from 'next/router'
import Image from 'next/image'
import { CLIENT_ORIGIN } from './util/requests'
const logo = (
<>
<Image
src="/logo.svg"
className="mr-2 rounded-lg"
alt="splits_logo"
width={20}
height={20}
/>
<span className="mr-2 font-semibold hidden md:inline">Splits</span>
<span className="text-gray-600 font-medium hidden md:inline">Docs</span>
</>
)
const config: DocsThemeConfig = {
project: {
link: 'https://github.com/0xSplits',
},
docsRepositoryBase: 'https://github.com/0xSplits/docs',
useNextSeoProps() {
const { asPath } = useRouter()
if (asPath !== '/') {
return {
titleTemplate: '%s | Splits',
}
}
},
logo,
head: function useHead() {
const { title } = useConfig()
const ogImage = `${CLIENT_ORIGIN}/api/og?title=${encodeURIComponent(title)}`
return (
<>
{/* Basic metadata */}
<meta charSet="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#fff" />
<meta httpEquiv="Content-Language" content="en" />
{/* Page description */}
<meta
name="description"
content="Software to manage onchain earnings"
/>
<meta
name="og:description"
content="Software to manage onchain earnings"
/>
{/* Twitter */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={ogImage} />
<meta name="twitter:site" content="@0xsplits" />
<meta name="twitter:site:domain" content="splits.org" />
<meta name="twitter:url" content="https://www.splits.org/" />
<meta
name="twitter:title"
content={title ? title + ' | Splits' : 'Splits'}
/>
<meta
name="twitter:description"
content="Software to manage onchain earnings"
/>
{/* Title */}
<meta
name="og:title"
content={title ? title + ' | Splits' : 'Splits'}
/>
<meta name="og:image" content={ogImage} />
{/* Open Graph */}
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:type" content="website" />
<meta property="og:url" content="docs.splits.org" />
<meta property="og:site_name" content="docs.splits.org" />
<meta name="apple-mobile-web-app-title" content="Splits" />
<link rel="icon" href="/logo_compressed.svg" type="image/svg+xml" />
</>
)
},
primaryHue: 215,
editLink: {
text: 'Edit this page on GitHub',
},
feedback: {
content: 'Question? Give us feedback',
labels: 'feedback',
},
sidebar: {
titleComponent({ title, type }) {
if (type === 'separator') {
return <span className="cursor-default">{title}</span>
}
return <div className="font-medium">{title}</div>
},
defaultMenuCollapseLevel: 2,
toggleButton: false,
},
footer: {
text: (
<div className="flex w-full items-center justify-between sm:items-start text-sm">
<div>
Questions? Join us in{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://chat.splits.org/"
>
Discord
</a>
</div>
<div>© {new Date().getFullYear()} Splits Protocols, Inc.</div>
</div>
),
},
}
export default config