Skip to content

Commit 2f53e5e

Browse files
authored
Upgrade Docusaurus from 3.7.0 to 3.9.2 (#1564)
* Move `onBrokenMarkdownLinks` to markdown hooks The onBrokenMarkdownLinks option was removed from the root config and added under markdown.hooks to align with updated Docusaurus configuration structure. This change complies with a change made in Docusaurus 3.9: facebook/docusaurus#11283 * Fix link to ABAC doc in Japanese * Upgrade Docusaurus from 3.7.0 to 3.9.1 * Change `current` to `3.15` in description * Add `onDuplicateRoutes` configuration * Fix incorrect label * Add `key` attributes for labels with duplicate names When labels have duplicate names, the sidebar must contain a `key` attribute. Without these `key` attributes, Docusaurus 3.9 (and likely later unless this specification changes) will encounter errors during the build process. As described in the Docusaurus blog post for 3.9: "In #11228, we added a new `key` attribute to the docs sidebar items, allowing to assign explicit translation keys to each sidebar item that use the same label and would otherwise lead to translation key conflicts." Related Docusaurus PR: facebook/docusaurus#11228 * Change URL identifiers Change as suggested by Gemini code review: #1564 (comment) * Ensure output directory exists before writing JSON Added logic to create the output directory if it does not exist before writing the glossary JSON file. This prevents errors when the specified output path's directory is missing. * Update Node.js version to `20` Bump Node.js version from `18` to `20` in deploy and test-deploy GitHub Actions workflows to ensure compatibility with the latest Node.js features and security updates. This is necessary because Docusaurus 3.9 drops support for Node.js 18: https://docusaurus.io/blog/releases/3.9#dropping-nodejs-18 * Add `colorMode` to respect user's light/dark theme preference Introduced a colorMode section in the Docusaurus config to set the default mode to light, enable the color mode switch, and respect the user's preferred color scheme. * Change format of `key` values Addresses the following comment made in the ScalarDL docs site repository: scalar-labs/docs-scalardl#1011 (comment) * Upgrade Docusaurus from 3.9.1 to 3.9.2
1 parent 9e43dc5 commit 2f53e5e

20 files changed

+1977
-1009
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fetch-depth: 0
1919
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 18
21+
node-version: 20
2222
cache: npm
2323

2424
- name: Install dependencies

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fetch-depth: 0
1919
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 18
21+
node-version: 20
2222
cache: npm
2323

2424
- name: Install dependencies

docusaurus.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const config = {
2525
projectName: 'docs-scalardb', // Usually your repo name.
2626

2727
onBrokenLinks: 'warn',
28-
onBrokenMarkdownLinks: 'ignore',
2928
onBrokenAnchors: 'ignore',
29+
onDuplicateRoutes: 'warn',
3030

3131
// Even if you don't use internationalization, you can use this field to set
3232
// useful metadata like html lang. For example, if your site is Chinese, you
@@ -374,6 +374,9 @@ const config = {
374374
],
375375
markdown: {
376376
mermaid: true,
377+
hooks: {
378+
onBrokenMarkdownLinks: 'ignore',
379+
},
377380
},
378381
themes: ['@docusaurus/theme-mermaid'],
379382

@@ -568,6 +571,11 @@ const config = {
568571
textColor: '#FFFFFF',
569572
isCloseable: false,
570573
},
574+
colorMode: {
575+
defaultMode: 'light',
576+
disableSwitch: false,
577+
respectPrefersColorScheme: true,
578+
},
571579
zoom: {
572580
selector: '.markdown :not(em) > img',
573581
background: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version.label": {
33
"message": "3.15",
4-
"description": "The label for version current"
4+
"description": "The label for version 3.15"
55
}
66
}

0 commit comments

Comments
 (0)