Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
143 lines (132 loc) · 4.56 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
143 lines (132 loc) · 4.56 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// @ts-check
const { themes: prismThemes } = require("prism-react-renderer");
// Build-time settings. Override them with environment variables (or Docker
// build args, see Dockerfile) to build the site for another domain, e.g. a
// temporary host before docs.gov.tools is switched over.
const siteUrl = process.env.DOCS_URL || "https://docs.gov.tools";
const baseUrl = process.env.DOCS_BASE_URL || "/";
// Set DOCS_NO_INDEX=true on temporary hosts (e.g. a github.io preview) so
// search engines do not index a copy of docs.gov.tools.
const noIndex = process.env.DOCS_NO_INDEX === "true";
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Governance Tools Documentation",
tagline: "User guides for Cardano GovTool and the Constitutional Committee Portal",
favicon: "img/favicon.svg",
url: siteUrl,
baseUrl,
noIndex,
organizationName: "IntersectMBO",
projectName: "govtool",
onBrokenLinks: "throw",
onBrokenAnchors: "warn",
markdown: {
// Pages were exported from GitBook as CommonMark with inline HTML, so
// .md files are parsed as plain Markdown rather than MDX.
format: "detect",
hooks: {
onBrokenMarkdownLinks: "throw",
},
},
i18n: {
defaultLocale: "en",
locales: ["en"],
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/IntersectMBO/govtool/edit/develop/docs/",
remarkPlugins: [[require("./src/remark/base-url-raw-html"), { baseUrl }]],
},
blog: false,
pages: false,
theme: {
customCss: [
require.resolve("@fontsource-variable/inter/index.css"),
require.resolve("./src/css/custom.css"),
],
},
}),
],
],
plugins: [
// The webpack cache in node_modules/.cache is only evicted when this file
// changes, not when DOCS_URL or DOCS_BASE_URL do. Without this, a build for
// /govtool/ right after one for / reuses CSS with root font paths.
function cacheKeyedOnBaseUrl() {
return {
name: "cache-keyed-on-base-url",
configureWebpack(webpackConfig) {
const { cache } = webpackConfig;
if (!cache || typeof cache !== "object") return {};
return { cache: { ...cache, version: `${cache.version}-${siteUrl}${baseUrl}` } };
},
};
},
[
"@docusaurus/plugin-client-redirects",
{
// Old URLs that are still linked from GovTool, the CC portal or GitBook.
redirects: [
{
from: "/cardano-govtool/faqs/how-was-the-author-of-withdraw-ara45-217-for-mlabs-core...-ga-verified",
to: "/cardano-govtool/faqs/how-was-the-author-of-withdraw-ara45-217-for-mlabs-core-ga-verified",
},
{
// "What is Cardano GovTool?" is now the home page.
from: "/overview/what-is-cardano-govtool",
to: "/",
},
{
// Linked from the Proposal Discussion submission flow in the GovTool frontend.
from: "/using-govtool/govtool-functions/storing-information-offline",
to: "/cardano-govtool/using-govtool/storing-information-offline",
},
{
// The GitBook section root; it has no page of its own here.
from: "/cardano-govtool",
to: "/cardano-govtool/using-govtool",
},
{
from: "/about/what-is-the-constitutional-committee-portal",
to: "/overview/what-is-the-constitutional-committee-portal",
},
],
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
respectPrefersColorScheme: true,
},
announcementBar: {
id: "maintenance-2026",
content:
`GovTool is actively maintained by the Sireto team. <a href="${baseUrl}important-updates/govtool-maintenance-2026">Read the 2026 update</a>`,
isCloseable: true,
},
navbar: {
title: "Governance Tools",
logo: {
alt: "GovTool logo",
src: "img/logo.svg",
},
items: [
{ href: "https://gov.tools", label: "GovTool", position: "right" },
{ href: "https://github.com/IntersectMBO/govtool", label: "GitHub", position: "right" },
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};
module.exports = config;