-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy paththeme.config.tsx
52 lines (49 loc) · 1.47 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
import React from 'react'
import { useRouter } from 'next/router'
import {DocsThemeConfig, useConfig} from 'nextra-theme-docs'
const title = '闪闪人生'
const description = '拥抱爱与成就,就用闪闪人生'
const keywords = '闪闪人生推进器, 人生战略, 人生规划, 人生目标, 选择, 战略管理, 帮手, 决策'
const url = 'https://sunnylife42.com/docs'
const config: DocsThemeConfig = {
logo: (
<img src="https://cdn.sunnyhuang.net/share/logo-full.png" alt="logo" style={{ height: 32 }} />
),
project: {
link: 'https://github.com/sunnylife42/docs',
},
docsRepositoryBase: 'https://github.com/sunnylife42/docs/blob/master',
useNextSeoProps() {
const { asPath } = useRouter()
if (asPath !== '/') {
return {
titleTemplate: `%s – ${title}`
}
}
},
head: () => {
const { asPath } = useRouter()
const config = useConfig()
return (
<>
<meta name="og:url" content={`${url}${asPath}`} />
<meta name="og:title" content={config.title ? `${config.title} – ${title}` : title} />
<meta name="og:image" content="https://cdn.sunnyhuang.net/share/logo-square.png" />
<meta name="keywords" content={keywords} />
</>
)
},
main: ({ children }) => (
<main id="main">
{children}
</main>
),
footer: {
text: (
<p className="nx-w-full nx-text-center">
© {new Date().getFullYear()} {title}
</p>
)
}
}
export default config