-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme.config.tsx
82 lines (75 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
import { DocsThemeConfig, useConfig } from "nextra-theme-docs";
import Footer from "@components/Footer";
import Link from "next/link";
import Logo from "./components/Logo";
import React from "react";
import TitleComponent from "@components/TitleComponent";
import { useRouter } from "next/router";
const siteTitle = "Canopy IIIF";
const siteUrl = "https://canopy-iiif.github.io/docs";
const siteDescription =
"a IIIF Collection sourced site generator in Next.js for digital collections, humanities, and exhibitions";
const config: DocsThemeConfig = {
useNextSeoProps() {
const { asPath } = useRouter();
const titleTemplate =
asPath === "/"
? `%s - Create a static site with a IIIF Collection`
: `%s – ${siteTitle}`;
return { titleTemplate };
},
banner: {
key: "0.12.0-release",
text: (
<Link href="/theming">
{" "}
Canopy IIIF 0.12.0 - "Themes" is released. Read more →
</Link>
),
},
head: () => {
const { asPath, defaultLocale, locale } = useRouter();
const { frontMatter } = useConfig();
const url =
siteUrl + (defaultLocale === locale ? asPath : `/${locale}${asPath}`);
/**
* Add any custom meta tags you want to add to the <head> tag here
* Nextra automatically adds description, og:description, og:title from front matter
*/
return (
<>
<meta property="og:url" content={url} />
<meta
property="og:image"
content={
frontMatter.image
? frontMatter.image
: `${siteUrl}/assets/canopy-iiif.png`
}
/>
</>
);
},
logo: <Logo />,
project: {
link: "https://github.com/canopy-iiif/canopy-iiif",
},
docsRepositoryBase: "https://github.com/canopy-iiif/docs/blob/main",
footer: {
text: <Footer description={siteDescription} />,
},
darkMode: true,
gitTimestamp: null,
nextThemes: {
defaultTheme: "light",
},
primaryHue: 225,
primarySaturation: 76,
sidebar: {
defaultMenuCollapseLevel: 1,
autoCollapse: true,
titleComponent: (props) => <TitleComponent {...props} />,
toggleButton: true,
},
};
export default config;