-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
62 lines (55 loc) · 1.7 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
import React from 'react'
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import { useRouter } from 'next/router';
function useHead() {
const { asPath } = useRouter();
const { frontMatter, title } = useConfig();
const url = `https://strange.frozenforest.us${asPath}`;
const description = frontMatter.description || "Strange Bot Documentation";
return (
<>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/assets/strange.png" />
<meta httpEquiv="Content-Language" content="en" />
<meta name="description" content={description} />
<meta name="og:title" content={title} />
<meta name="og:description" content={description} />
<meta name="og:url" content={url} />
</>
);
}
function useNextSeoProps() {
const { asPath } = useRouter();
const arr = asPath.replace(/[-_]/g, ' ').split('/');
const rawTitle = arr[arr.length - 1];
const title = /[a-z]/.test(rawTitle) && /[A-Z]/.test(rawTitle) ? rawTitle : '%s';
if (asPath === "/") {
return {
titleTemplate: `Strange Documentation`,
}
}
}
const config: DocsThemeConfig = {
logo: (
<div
style={{
paddingLeft: '50px',
lineHeight: '38px',
background: "url('./assets/strange.png') no-repeat left",
backgroundSize: '64px',
fontWeight: 550,
}}
>
<p style={{marginLeft: "20px"}}> Strange Bot Documents</p>
</div>
),
chat: {
link: 'https://discord.gg/B8XtAwdeVV',
},
head: useHead,
footer: {
text: 'Made with love by Darknessbless',
},
useNextSeoProps: useNextSeoProps,
}
export default config