Skip to content

Commit 799a5e7

Browse files
committed
Upgrade Docusaurus to v3
1 parent 93efb0d commit 799a5e7

3 files changed

Lines changed: 62 additions & 18 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
name: Build and validate
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 20
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: yarn
30+
31+
- name: Enable Yarn
32+
run: |
33+
corepack enable
34+
corepack prepare yarn@1.22.22 --activate
35+
yarn --version
36+
37+
- name: Install dependencies
38+
run: yarn install --ignore-scripts --non-interactive
39+
40+
- name: Build site
41+
run: yarn build
42+
43+
- name: Audit dependencies
44+
run: yarn audit --groups dependencies --level high

docusaurus.config.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4-
const lightCodeTheme = require('prism-react-renderer/themes/github');
5-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
4+
const {themes} = require('prism-react-renderer');
65

76
/** @type {import('@docusaurus/types').Config} */
87
const config = {
@@ -41,6 +40,9 @@ const config = {
4140
blogSidebarCount: 'ALL',
4241
postsPerPage: 5,
4342
},
43+
googleAnalytics: {
44+
trackingID: 'UA-126627606-1',
45+
},
4446
theme: {
4547
customCss: require.resolve('./src/css/custom.css'),
4648
},
@@ -127,12 +129,9 @@ const config = {
127129
copyright: `Copyright © ${new Date().getFullYear()} Andreas Marek.`,
128130
},
129131
prism: {
130-
theme: lightCodeTheme,
131-
darkTheme: darkCodeTheme,
132+
theme: themes.github,
133+
darkTheme: themes.dracula,
132134
additionalLanguages: ['java', 'groovy', 'kotlin'],
133-
},
134-
googleAnalytics: {
135-
trackingID: 'UA-126627606-1',
136135
}
137136
}),
138137
};

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "website",
33
"version": "0.0.0",
44
"private": true,
5+
"packageManager": "yarn@1.22.22",
6+
"engines": {
7+
"node": ">=18.0"
8+
},
59
"scripts": {
610
"docusaurus": "docusaurus",
711
"start": "docusaurus start",
@@ -14,16 +18,13 @@
1418
"write-heading-ids": "docusaurus write-heading-ids"
1519
},
1620
"dependencies": {
17-
"@docusaurus/core": "2.0.0-beta.9",
18-
"@docusaurus/preset-classic": "2.0.0-beta.9",
19-
"@mdx-js/react": "^1.6.21",
20-
"@svgr/webpack": "^5.5.0",
21-
"clsx": "^1.1.1",
22-
"file-loader": "^6.2.0",
23-
"prism-react-renderer": "^1.2.1",
24-
"react": "^17.0.1",
25-
"react-dom": "^17.0.1",
26-
"url-loader": "^4.1.1"
21+
"@docusaurus/core": "3.10.1",
22+
"@docusaurus/preset-classic": "3.10.1",
23+
"@mdx-js/react": "^3.1.1",
24+
"clsx": "^2.1.1",
25+
"prism-react-renderer": "^2.4.1",
26+
"react": "^18.3.1",
27+
"react-dom": "^18.3.1"
2728
},
2829
"browserslist": {
2930
"production": [
@@ -37,4 +38,4 @@
3738
"last 1 safari version"
3839
]
3940
}
40-
}
41+
}

0 commit comments

Comments
 (0)