-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
79 lines (73 loc) · 2.21 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
import React from 'react'
import { DocsThemeConfig, useConfig } from 'nextra-theme-docs'
const metaDescription = 'How to run a secure online election'
const config: DocsThemeConfig = {
logo: (
<img
className='w-12 cursor-pointer dark:brightness-[50]'
src='/images/logo.png'
alt='logo'
/>
),
docsRepositoryBase: 'https://github.com/dsernst/siv-docs/blob/main',
editLink: { component: () => null },
feedback: {
useLink: () => {
const { title } = useConfig()
return `mailto:[email protected]?subject=${encodeURI(
`Feedback for: "${title}"`
)}`
}
},
footer: { text: 'Secure Internet Voting Inc.' },
components: {
ol: (props) => (
<ol className='nx-list-decimal ltr:nx-ml-6 rtl:nx-mr-6' {...props} />
)
},
useNextSeoProps: () => {
const { frontMatter } = useConfig()
return {
titleTemplate: '%s · SIV',
description: metaDescription,
openGraph: {
title: `${frontMatter.title} · SIV`,
description: metaDescription
}
}
},
head: function useHead() {
const { title } = useConfig()
return (
<>
<meta name='msapplication-TileColor' content='#fff' />
<meta name='theme-color' content='#fff' />
<meta name='robots' content='index,follow' />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta httpEquiv='Content-Language' content='en' />
<meta name='description' content={metaDescription} />
<meta name='og:description' content={metaDescription} />
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:site:domain' content='book.siv.org' />
<meta name='twitter:url' content='https://book.siv.org' />
<meta name='og:title' content={title ? title + ' · SIV' : 'SIV'} />
<meta name='apple-mobile-web-app-title' content='SIV Book' />
</>
)
},
main: (props) => {
const config = useConfig()
return (
<>
{config.title && (
<h1 className='my-2 mb-4 text-3xl font-bold'>{config.title}</h1>
)}
<main {...props} />
</>
)
},
sidebar: {
defaultMenuCollapseLevel: 1
}
}
export default config