Skip to content

Commit 55c63e8

Browse files
committed
ci: add GitHub Actions workflow for documentation deployment
- Created `.github/workflows/docs.yml` for deploying documentation to GitHub Pages on `main` branch updates. - Configured Docusaurus site with `docusaurus.config.js`, `package.json`, and `pnpm-lock.yaml`. - Added custom theming in `custom.css` and updated `.gitignore` for `website` build artifacts.
1 parent bf7f1b9 commit 55c63e8

11 files changed

Lines changed: 12564 additions & 2 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'website/**'
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: pnpm/action-setup@v4
27+
with:
28+
version: latest
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 24
33+
cache: pnpm
34+
cache-dependency-path: website/pnpm-lock.yaml
35+
36+
- name: Install dependencies
37+
working-directory: website
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build
41+
working-directory: website
42+
run: pnpm run build
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: website/build
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ A WordPress plugin that renders programmatic toast notifications via the [Intera
44

55
## 📚 Documentation
66

7+
Published: https://spaghetti-dojo.github.io/tosuto/
8+
79
- [Overview](docs/index.md)
8-
- [PHP API](docs/server/php-api.md) — `wp_tosuto()`, `wp_tosuto_remove()`, hooks, classes
9-
- [JavaScript / TypeScript API](docs/client/js-api.md) — Interactivity API store, actions, types, value objects
10+
- [PHP API](docs/server/php-api.md) — `wp_tosuto()`, `wp_tosuto_remove()`, hooks
11+
- [JavaScript / TypeScript API](docs/client/js-api.md) — Interactivity API store, actions, types
1012

1113
## 📋 Requirements
1214

‎docs/client/js-api.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
15
# JavaScript / TypeScript API
26

37
The client-side code is built with TypeScript and runs via the [WordPress Interactivity API](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/). All interactive behavior lives in the `wp-tosuto` store namespace.

‎docs/index.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
slug: /
3+
sidebar_position: 1
4+
---
5+
16
# WP Tosuto — Documentation
27

38
WP Tosuto is a WordPress plugin that renders programmatic toast notifications via the [WordPress Interactivity API](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/), inspired by [shadcn/ui](https://ui.shadcn.com/).

‎docs/server/php-api.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
15
# PHP API
26

37
## Functions

‎website/.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
build/
3+
.docusaurus/

‎website/docusaurus.config.js‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// @ts-check
2+
import { themes as prismThemes } from 'prism-react-renderer';
3+
4+
/** @type {import('@docusaurus/types').Config} */
5+
const config = {
6+
title: 'WP Tosuto',
7+
tagline: 'Programmatic toast notifications for WordPress',
8+
9+
url: 'https://spaghetti-dojo.github.io',
10+
baseUrl: '/tosuto/',
11+
12+
organizationName: 'Spaghetti-Dojo',
13+
projectName: 'tosuto',
14+
15+
future: {
16+
faster: true,
17+
v4: true,
18+
},
19+
20+
onBrokenLinks: 'throw',
21+
markdown: {
22+
hooks: {
23+
onBrokenMarkdownLinks: 'warn',
24+
},
25+
},
26+
27+
i18n: {
28+
defaultLocale: 'en',
29+
locales: [ 'en' ],
30+
},
31+
32+
presets: [
33+
[
34+
'classic',
35+
/** @type {import('@docusaurus/preset-classic').Options} */
36+
( {
37+
docs: {
38+
routeBasePath: '/',
39+
path: '../docs',
40+
sidebarPath: './sidebars.js',
41+
},
42+
blog: false,
43+
theme: {
44+
customCss: './src/css/custom.css',
45+
},
46+
} ),
47+
],
48+
],
49+
50+
themeConfig:
51+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
52+
( {
53+
navbar: {
54+
title: 'WP Tosuto',
55+
items: [
56+
{
57+
href: 'https://github.com/Spaghetti-Dojo/tosuto',
58+
label: 'GitHub',
59+
position: 'right',
60+
},
61+
],
62+
},
63+
footer: {
64+
style: 'dark',
65+
links: [
66+
{
67+
title: 'API',
68+
items: [
69+
{ label: 'PHP API', to: '/server/php-api' },
70+
{ label: 'JavaScript API', to: '/client/js-api' },
71+
],
72+
},
73+
{
74+
title: 'More',
75+
items: [
76+
{
77+
label: 'GitHub',
78+
href: 'https://github.com/Spaghetti-Dojo/tosuto',
79+
},
80+
{
81+
label: 'Issues',
82+
href: 'https://github.com/Spaghetti-Dojo/tosuto/issues',
83+
},
84+
],
85+
},
86+
],
87+
copyright: `Copyright © ${ new Date().getFullYear() } Spaghetti Dojo. Built with Docusaurus.`,
88+
},
89+
prism: {
90+
theme: prismThemes.github,
91+
darkTheme: prismThemes.dracula,
92+
additionalLanguages: [ 'php' ],
93+
},
94+
} ),
95+
};
96+
97+
export default config;

‎website/package.json‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "wp-tosuto-docs",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"start": "docusaurus start",
7+
"build": "docusaurus build",
8+
"deploy": "docusaurus deploy",
9+
"clear": "docusaurus clear",
10+
"serve": "docusaurus serve"
11+
},
12+
"dependencies": {
13+
"@docusaurus/core": "3.10.0",
14+
"@docusaurus/faster": "3.10.0",
15+
"@docusaurus/preset-classic": "3.10.0",
16+
"@mdx-js/react": "^3.0.0",
17+
"clsx": "^2.0.0",
18+
"prism-react-renderer": "^2.3.0",
19+
"react": "^18.0.0",
20+
"react-dom": "^18.0.0"
21+
},
22+
"devDependencies": {
23+
"@docusaurus/module-type-aliases": "3.10.0",
24+
"@docusaurus/tsconfig": "3.10.0",
25+
"@docusaurus/types": "3.10.0"
26+
},
27+
"engines": {
28+
"node": ">=18.0"
29+
}
30+
}

0 commit comments

Comments
 (0)