-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
218 lines (204 loc) · 7.26 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
218 lines (204 loc) · 7.26 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config
import legacyDocRedirects from './src/data/legacy-doc-redirects.json';
import {themes as prismThemes} from 'prism-react-renderer';
import {defaultLocale, localeConfigs, locales, docsBaseUrl} from './i18n.config.mjs';
import screenshotImages from './src/remark/screenshot-images.js';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'AIPOCH Open-Science Documentation',
tagline: 'A local-first AI workspace for reproducible scientific research',
// Same file aipoch.com serves at /favicon.ico — 16/32/48 PNG-in-ICO.
favicon: 'img/aipoch-favicon.ico',
// Docusaurus emits og:title/description/image/url and twitter:card/image by
// default. These are the site-level tags it does not derive on its own.
// twitter:title/description are page-level and live in src/pages/index.js.
headTags: [
{tagName: 'meta', attributes: {property: 'og:type', content: 'website'}},
{tagName: 'meta', attributes: {property: 'og:site_name', content: 'AIPOCH Open-Science Documentation'}},
{tagName: 'meta', attributes: {name: 'twitter:site', content: '@AIPOCH_AI'}},
],
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
future: {
v4: true, // Improve compatibility with the upcoming Docusaurus v4
// Docusaurus 3.10.2's Rspack server bundle leaves route-registry
// require.resolveWeak calls untransformed. Keep the stable Webpack path.
faster: false,
},
// Set the production url of your site here
url: 'https://aipoch.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: docsBaseUrl,
// Keep generated URLs consistent with the directory URLs served by Nginx.
trailingSlash: true,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'aipoch',
projectName: 'openscience-wiki',
onBrokenLinks: 'throw',
themes: [['./src/plugins/localized-search.cjs', {
hashed: 'filename',
docsRouteBasePath: '/',
indexDocs: true,
indexBlog: false,
indexPages: false,
// Keep old bookmarks working without returning navigation-only bridge pages in search.
ignoreFiles: [],
highlightSearchTermsOnTargetPage: true,
explicitSearchResultPath: true,
searchBarShortcutHint: true,
fuzzyMatchingDistance: 0,
}]],
// Preserve old bookmarks after the requested Changelog URL rename.
// This produces static client redirects for each locale, without server changes.
plugins: ['./src/plugins/locale-sitemap.cjs', ['@docusaurus/plugin-client-redirects', {
redirects: [
...Object.entries(legacyDocRedirects).map(([from, to]) => ({from: `/${from}/`, to: `/${to}/`})),
{from: '/releases/v0-26-0/', to: '/changelog/v0-26-0/'},
{from: '/releases/v0-25-1/', to: '/changelog/v0-25-1/'},
{from: '/category/reference-and-troubleshooting/', to: '/reference/'},
],
}]],
// Keep the locale registry separate so more overseas languages can be added
// without changing the rest of the site configuration.
i18n: {
defaultLocale,
locales,
localeConfigs,
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.js',
remarkPlugins: [screenshotImages],
// Read explicit content dates even when Git is absent in Docker.
showLastUpdateTime: true,
},
blog: false,
sitemap: {
lastmod: 'date',
createSitemapItems: async ({defaultCreateSitemapItems, ...params}) => {
// Missing dates must stay absent: the default fallback queries Git,
// which is unavailable in the production Docker build context.
const withExplicitDates = (routes) => routes.map((route) => ({
...route,
metadata: {
...route.metadata,
lastUpdatedAt: route.metadata?.lastUpdatedAt ?? null,
},
...(route.routes && {routes: withExplicitDates(route.routes)}),
}));
const items = await defaultCreateSitemapItems({
...params,
routes: withExplicitDates(params.routes),
});
// The client-side search page has no standalone search value.
return items.filter((item) => !/\/search\/$/.test(item.url));
},
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/open-science/conversation-completed.png',
colorMode: {
respectPrefersColorScheme: true,
},
navbar: {
title: 'AIPOCH',
logo: {
alt: 'AIPOCH',
src: 'img/aipoch-logo.svg',
srcDark: 'img/aipoch-logo-dark.svg',
},
items: [
{
href: 'https://aipoch.com/open-science',
position: 'left',
label: 'Open-Science',
},
{to: 'guides/installation', label: 'Install', position: 'left'},
{
to: 'guides/troubleshooting',
label: 'Troubleshooting',
position: 'left',
},
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/aipoch/open-science',
label: 'Open-Science GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Documentation',
items: [
{
label: 'Open-Science',
to: '/',
},
{
label: 'Control index',
to: 'reference/control-index',
},
],
},
{
title: 'Project',
items: [
{
label: 'Open-Science',
href: 'https://github.com/aipoch/open-science',
},
{
label: 'Wiki source',
href: 'https://github.com/aipoch/openscience-wiki',
},
{
label: 'Report an issue',
href: 'https://github.com/aipoch/open-science/issues',
},
],
},
{
title: 'AIPOCH',
items: [
{
label: 'Website',
href: 'https://aipoch.com',
},
],
},
],
copyright: `© ${new Date().getFullYear()} AIPOCH · All Rights Reserved.`,
},
prism: {
// AIPOCH style: code blocks stay dark in both light and dark mode
theme: prismThemes.vsDark,
darkTheme: prismThemes.vsDark,
},
}),
};
export default config;