generated from acmucsd/website-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.config.tsx
67 lines (60 loc) · 1.97 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
/* eslint-disable react-hooks/rules-of-hooks */
import React from 'react';
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs';
import { useRouter } from 'next/router';
import Logo from './public/Logo';
const config: DocsThemeConfig = {
logo: <Logo />,
head: () => {
const { asPath, defaultLocale, locale } = useRouter();
const { frontMatter } = useConfig();
const url = `https://hacktextbook.acmucsd.com${
defaultLocale === locale ? asPath : `/${locale}${asPath}`
}`;
const title = frontMatter.title || 'ACM Hack at UC San Diego Textbook';
const description =
frontMatter.description ||
"ACM Hack at UC San Diego is a community focused on software engineering and exploring what's possible through code!";
return (
<>
{/* google indexing data */}
<title>{title}</title>
<meta name="description" content={description} />
<link rel="shortcut icon" href="/favicon.ico" />
{/* link sharing data */}
{/* page url to be used as permanent id */}
<meta property="og:url" content={url} />
{/* type of content */}
<meta property="og:type" content="website" />
{/* actual website title */}
<meta property="og:site_name" content="ACM Hack at UC San Diego Textbook" />
{/* title to display for the specific link being shared */}
<meta property="og:title" content={title} />
{/* preview description text */}
<meta property="og:description" content={description} />
</>
);
},
useNextSeoProps() {
const { asPath } = useRouter();
if (asPath !== '/') {
return {
titleTemplate: '%s – ACM Hack',
};
}
return {
titleTemplate: '%s',
};
},
footer: {
text: 'Made with 🧡 by ACM Hack!',
},
search: {
placeholder: 'Search',
},
sidebar: {
toggleButton: true,
},
docsRepositoryBase: 'https://github.com/acmucsd/hack-textbook/blob/main',
};
export default config;