-
Notifications
You must be signed in to change notification settings - Fork 37
/
theme.config.tsx
87 lines (82 loc) · 2.16 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
import { useRouter } from 'next/router';
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import Banner from './components/banner';
import { NavCTA, TocCTA } from './components/cta';
import Footer from './components/footer';
import { Logo } from './components/logo';
import { Flexsearch } from './components/nextra/Flexsearch';
const config: DocsThemeConfig = {
logo: Logo,
logoLink: 'https://authzed.com',
project: { link: 'https://github.com/authzed/spicedb' },
useNextSeoProps() {
const { asPath } = useRouter();
const { title, frontMatter } = useConfig();
const desc =
frontMatter.description ||
'Welcome to the SpiceDB and AuthZed docs site.';
const defaultConfig = {
defaultTitle: 'AuthZed Docs',
titleTemplate: '%s – AuthZed Docs',
description: desc,
canonical: `https://authzed.com${process.env.BASE_DIR ?? ''}${asPath}`, // NOTE: Update this if the base dir ever changes
openGraph: {
title,
description: desc,
},
};
return defaultConfig;
},
head: () => {
const isProd = process.env.VERCEL_ENV === 'production';
return (
<>
{isProd && (
<script
defer
data-domain="authzed.com"
data-api="/api/event"
src="/js/script.js"
></script>
)}
</>
);
},
darkMode: true,
primaryHue: { dark: 45, light: 290 },
primarySaturation: { dark: 100, light: 100 },
chat: { link: 'https://discord.gg/spicedb' },
docsRepositoryBase: 'https://github.com/authzed/docs/blob/main',
banner: {
dismissible: false,
text: <Banner />,
},
navbar: {
extraContent: <NavCTA />,
},
sidebar: {
toggleButton: true,
defaultMenuCollapseLevel: 2,
},
feedback: {
content: (
<span>
Something unclear?
<br />
Create an issue →
</span>
),
},
toc: { backToTop: true, extraContent: <TocCTA /> },
footer: {
component: <Footer />,
},
...(process.env.NEXT_PUBLIC_ENABLE_SEARCH_BLOG_INTEGRATION === 'true'
? {
search: {
component: <Flexsearch />,
},
}
: {}),
};
export default config;