-
Notifications
You must be signed in to change notification settings - Fork 13
/
docusaurus.config.ts
118 lines (105 loc) · 3.47 KB
/
docusaurus.config.ts
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import path from "path";
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
import { generateMainLinks } from "./scripts/generate-main-links";
import { Link } from "./src/interfaces/link";
import { generateSubLinks } from "./scripts/generate-sub-links";
const mainLinks = generateMainLinks();
const config: Config = {
title: "Digital Trust Toolkit",
tagline:
"This toolkit will guide you on implementing secure and user-friendly digital and in-person interactions. Whether you are a service owner, developer or somewhere in between; use it to navigate your adoption journey with practical workshops, templates and guides.",
favicon: "img/favicon.ico",
staticDirectories: ['related_resources', 'static'],
// Set the production url of your site here
url: "https://bcgov.github.io",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/digital-trust-toolkit",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "bcgov", // Usually your GitHub org/user name.
projectName: "digital-trust-toolkit", // Usually your repo name.
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
presets: [
[
"classic",
{
docs: {
sidebarPath: "./sidebars.ts",
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/bcgov/digital-trust-toolkit/tree/main/",
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/bcgov/digital-trust-toolkit/tree/main/",
},
theme: {
customCss: "./src/css/custom.css",
},
} satisfies Preset.Options,
],
],
plugins: [require.resolve("docusaurus-lunr-search")],
themeConfig: {
navbar: {
style: "primary",
title: "DTT",
items: [
...mainLinks.map((link: Link) => ({
type: "docSidebar",
sidebarId: link.id,
position: "left" as const,
label: link.label,
metadata: {
to: link.to,
description: link.description,
autogenerated: true,
sublinks: generateSubLinks(
path.resolve(__dirname, link.to)
),
},
})),
{ to: "/blog", label: "Roadmap", position: "left" },
{
href: "https://digital.gov.bc.ca/digital-trust/home",
label: "About",
position: "right",
},
],
},
prism: {
theme: prismThemes.github,
},
colorMode: {
disableSwitch: true,
},
} satisfies Preset.ThemeConfig,
customFields: {
// Add custom fields here
sidebars: mainLinks.reduce((acc, link: Link) => {
return {
...acc,
[link.id]: [
{
type: "autogenerated",
dirName: link.name,
},
],
};
}, {}),
},
};
export default config;