Skip to content

Commit 9a9f29e

Browse files
committed
feat: upgrade to docusaurus 3
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
1 parent 29527a4 commit 9a9f29e

17 files changed

+16298
-8574
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: CI
33
on:
44
pull_request:
55

6-
76
permissions:
87
contents: read
98

@@ -29,7 +28,7 @@ jobs:
2928
run: nix develop --impure .#ci
3029

3130
- name: Download dependencies
32-
run: nix develop --impure .#ci -c yarn install --frozen-lockfile
31+
run: nix develop --impure .#ci -c npm install
3332

3433
- name: Build
35-
run: nix develop --impure .#ci -c yarn build
34+
run: nix develop --impure .#ci -c npm run build

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6
3535

3636
- name: Download dependencies
37-
run: nix develop --impure .#ci -c yarn install --frozen-lockfile
37+
run: nix develop --impure .#ci -c npm install
3838

3939
- name: Build
40-
run: nix develop --impure .#ci -c yarn build
40+
run: nix develop --impure .#ci -c npm run build
4141

4242
- name: Upload artifact
4343
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
# TwirPHP website
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.
44

5-
### Installation
5+
## Installation
66

7-
```
8-
$ yarn
7+
```shell
8+
yarn
99
```
1010

11-
### Local Development
11+
## Local Development
1212

13-
```
14-
$ yarn start
13+
```shell
14+
npm run start
1515
```
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

19-
### Build
19+
## Build
2020

21-
```
22-
$ yarn build
21+
```shell
22+
npm run build
2323
```
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26-
27-
### Deployment
28-
29-
```
30-
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31-
```
32-
33-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

docusaurus.config.js

Lines changed: 0 additions & 126 deletions
This file was deleted.

docusaurus.config.ts

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import {themes as prismThemes} from 'prism-react-renderer';
2+
import type {Config} from '@docusaurus/types';
3+
import type * as Preset from '@docusaurus/preset-classic';
4+
5+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
6+
7+
const config: Config = {
8+
title: 'TwirPHP',
9+
tagline: 'Twitch\'s simple RPC framework powered by protobuf, ported to PHP',
10+
// favicon: 'img/favicon.ico',
11+
12+
url: 'https://twirphp.github.io',
13+
baseUrl: '/',
14+
trailingSlash: false,
15+
16+
organizationName: 'twirphp',
17+
projectName: 'twirphp.github.io',
18+
19+
onBrokenLinks: 'throw',
20+
onBrokenMarkdownLinks: 'warn',
21+
22+
i18n: {
23+
defaultLocale: 'en',
24+
locales: ['en'],
25+
},
26+
27+
presets: [
28+
[
29+
'classic',
30+
{
31+
docs: {
32+
sidebarPath: './sidebars.ts',
33+
editUrl: 'https://github.com/twirphp/twirphp.github.io/edit/main/',
34+
},
35+
theme: {
36+
customCss: './src/css/custom.css',
37+
},
38+
} satisfies Preset.Options,
39+
],
40+
],
41+
42+
themeConfig: {
43+
// Replace with your project's social card
44+
// image: 'img/docusaurus-social-card.jpg',
45+
navbar: {
46+
// title: 'TwirPHP',
47+
logo: {
48+
alt: 'TwirPHP',
49+
src: 'img/logo.svg',
50+
srcDark: 'img/logo-dark.svg',
51+
},
52+
items: [
53+
{
54+
type: 'docSidebar',
55+
sidebarId: 'docs',
56+
position: 'left',
57+
label: 'Docs',
58+
},
59+
{
60+
href: 'https://twitchtv.github.io/twirp/',
61+
label: 'Twirp website',
62+
},
63+
{
64+
to: 'community',
65+
label: 'Community',
66+
position: 'right'
67+
},
68+
{
69+
href: 'https://github.com/twirphp/twirp/releases/latest',
70+
position: 'right',
71+
className: 'header-download-link header-icon-link',
72+
'aria-label': 'Download',
73+
},
74+
{
75+
href: 'https://github.com/twirphp/twirp',
76+
// label: 'GitHub',
77+
position: 'right',
78+
className: 'header-github-link header-icon-link',
79+
'aria-label': 'GitHub repository',
80+
},
81+
],
82+
},
83+
footer: {
84+
style: 'dark',
85+
links: [
86+
{
87+
title: 'Docs',
88+
items: [
89+
{
90+
label: 'About',
91+
to: '/docs/about',
92+
},
93+
{
94+
label: 'Quickstart',
95+
to: '/docs/quickstart',
96+
},
97+
{
98+
label: 'Overview',
99+
to: '/docs/overview',
100+
},
101+
],
102+
},
103+
{
104+
title: 'Community',
105+
items: [
106+
{
107+
label: 'Get in touch',
108+
href: '/community',
109+
},
110+
{
111+
label: 'GitHub',
112+
href: 'https://github.com/twirphp/twirp',
113+
},
114+
],
115+
},
116+
],
117+
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://sagikazarmark.hu">Márk Sági-Kazár</a>.`,
118+
},
119+
prism: {
120+
theme: prismThemes.github,
121+
darkTheme: prismThemes.dracula,
122+
additionalLanguages: ['protobuf', 'php'],
123+
},
124+
} satisfies Preset.ThemeConfig,
125+
};
126+
127+
export default config;

flake.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
pre-commit.hooks = {
2323
nixpkgs-fmt.enable = true;
24-
yamllint.enable = true;
2524
};
2625

2726
packages = with pkgs; [

0 commit comments

Comments
 (0)