-
Notifications
You must be signed in to change notification settings - Fork 15
/
theme.config.tsx
77 lines (71 loc) · 2.01 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
import { DocsThemeConfig } from "nextra-theme-docs";
import Logo from "./docs/components/Logo";
import React from "react";
import TitleComponent from "./docs/components/TitleComponent";
import { useConfig } from "nextra-theme-docs";
import { useMemo } from "react";
import { useRouter } from "next/router";
const siteTitle = "Clover IIIF";
const siteDescription = "Showcase IIIF Manifests as interoperable web content.";
const config: DocsThemeConfig = {
darkMode: true,
nextThemes: {
defaultTheme: "system",
},
docsRepositoryBase: "https://github.com/samvera-labs/clover-iiif",
footer: {
text: "Extensible IIIF front-end toolkit and Manifest viewer. Accessible. Composable. Open Source.",
},
useNextSeoProps() {
const config = useConfig();
const title = config.frontMatter.title
? `${config.frontMatter.title} – ${siteTitle}`
: `${siteTitle} – ${siteDescription}`;
const description = config.frontMatter.description
? config.frontMatter.description
: siteDescription;
const { route } = useRouter();
const canonical = useMemo(
() =>
new URL(
route.endsWith("/") ? route : `${route}/`,
"https://samvera-labs.github.io/clover-iiif/",
).href,
[route],
);
return {
defaultTitle: `${siteTitle} - ${siteDescription}`,
title,
description,
canonical,
openGraph: {
url: canonical,
title,
siteName: `${siteTitle} - ${siteDescription}`,
images: [
{
url: "",
type: "image/png",
width: 1200,
height: 675,
},
],
},
twitter: {
cardType: "summary_large_image",
},
};
},
logo: <Logo />,
project: {
link: "https://github.com/samvera-labs/clover-iiif",
},
primaryHue: 209,
sidebar: {
autoCollapse: true,
defaultMenuCollapseLevel: 1,
titleComponent: (props) => <TitleComponent {...props} />,
toggleButton: true,
},
};
export default config;