Skip to content

Commit 4aa7d63

Browse files
authored
convert docs to Vitepress (#184)
1 parent f19385d commit 4aa7d63

36 files changed

+2845
-712
lines changed

.github/workflows/deploy_docs_2x.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ jobs:
2020
uses: dokku/github-action@master
2121
with:
2222
git_remote_url: 'ssh://dokku@apps.cakephp.org:22/queue-docs-2'
23+
git_push_flags: '-f'
2324
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}
25+
branch: '2.x'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Documentation Validation
2+
3+
on:
4+
push:
5+
branches:
6+
- 2.x
7+
paths:
8+
- 'docs/**'
9+
- '.github/**'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
- '.github/**'
14+
15+
jobs:
16+
validate:
17+
uses: cakephp/.github/.github/workflows/docs-validation.yml@5.x
18+
with:
19+
docs-path: 'docs'
20+
vitepress-path: 'docs/.vitepress'
21+
enable-config-js-check: true
22+
enable-json-lint: true
23+
enable-toc-check: true
24+
enable-spell-check: true
25+
enable-markdown-lint: true
26+
enable-link-check: true
27+
tools-ref: '5.x'

Dockerfile

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
1-
# Basic docker based environment
2-
# Necessary to trick dokku into building the documentation
3-
# using dockerfile instead of herokuish
4-
FROM ubuntu:22.04
5-
6-
# Add basic tools
7-
RUN apt-get update && \
8-
apt-get install -y build-essential \
9-
software-properties-common \
10-
curl \
11-
git \
12-
libxml2 \
13-
libffi-dev \
14-
libssl-dev && \
15-
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \
16-
apt-get update && \
17-
apt-get install -y php8.1-cli php8.1-mbstring php8.1-xml php8.1-zip php8.1-intl php8.1-opcache php8.1-sqlite &&\
18-
apt-get clean &&\
19-
rm -rf /var/lib/apt/lists/*
20-
21-
WORKDIR /code
22-
23-
VOLUME ["/code"]
24-
25-
CMD [ '/bin/bash' ]
1+
# ----------------------
2+
# 1. Build stage
3+
# ----------------------
4+
FROM node:24-alpine AS builder
5+
6+
# Git is required because docs/package.json pulls a dependency from GitHub.
7+
RUN apk add --no-cache git openssh-client
8+
9+
WORKDIR /app/docs
10+
11+
# Copy dependency manifests first to preserve Docker layer caching.
12+
COPY docs/ ./
13+
RUN npm ci
14+
15+
# Increase max-old-space-size to avoid memory issues during build
16+
#ENV NODE_OPTIONS="--max-old-space-size=8192"
17+
18+
# Build the site.
19+
RUN npm run docs:build
20+
21+
# ----------------------
22+
# 2. Runtime stage (angie)
23+
# ----------------------
24+
FROM docker.angie.software/angie:latest AS runner
25+
26+
# Copy built files
27+
COPY --from=builder /app/docs/.vitepress/dist /usr/share/angie/html
28+
29+
# Expose port
30+
EXPOSE 80
31+
32+
# Health check (optional)
33+
HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
34+
35+
# Start angie
36+
CMD ["angie", "-g", "daemon off;"]

docs.Dockerfile

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

docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*/public/
3+
.vitepress/cache
4+
.vitepress/dist

docs/.vitepress/config.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import baseConfig from '@cakephp/docs-skeleton/config'
2+
import { createRequire } from 'module'
3+
4+
const require = createRequire(import.meta.url)
5+
const tocEn = require('./toc_en.json')
6+
7+
const versions = {
8+
text: '2.x',
9+
items: [
10+
{ text: '2.x (current)', link: 'https://book.cakephp.org/queue/2/', target: '_self' },
11+
{ text: '1.x', link: 'https://book.cakephp.org/queue/1/en/', target: '_self' },
12+
],
13+
}
14+
15+
export default {
16+
extends: baseConfig,
17+
srcDir: '.',
18+
title: 'Queue',
19+
description: 'CakePHP Queue Documentation',
20+
base: '/queue/2/',
21+
rewrites: {
22+
'en/:slug*': ':slug*',
23+
},
24+
sitemap: {
25+
hostname: 'https://book.cakephp.org/queue/2/',
26+
},
27+
themeConfig: {
28+
siteTitle: false,
29+
pluginName: 'Queue',
30+
socialLinks: [
31+
{ icon: 'github', link: 'https://github.com/cakephp/queue' },
32+
],
33+
editLink: {
34+
pattern: 'https://github.com/cakephp/queue/edit/2.x/docs/:path',
35+
text: 'Edit this page on GitHub',
36+
},
37+
sidebar: tocEn,
38+
nav: [
39+
{ text: 'CakePHP', link: 'https://cakephp.org' },
40+
{ text: 'API', link: 'https://api.cakephp.org/queue/' },
41+
{ ...versions },
42+
],
43+
},
44+
locales: {
45+
root: {
46+
label: 'English',
47+
lang: 'en',
48+
themeConfig: {
49+
sidebar: tocEn,
50+
},
51+
},
52+
},
53+
}

docs/.vitepress/theme/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@cakephp/docs-skeleton'

docs/.vitepress/toc_en.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"/": [
3+
{
4+
"text": "Getting Started",
5+
"collapsed": false,
6+
"items": [
7+
{ "text": "Installation and Configuration", "link": "/installation" },
8+
{ "text": "Defining and Queueing Jobs", "link": "/jobs" }
9+
]
10+
},
11+
{
12+
"text": "Processing Work",
13+
"collapsed": false,
14+
"items": [
15+
{ "text": "Queueing Mail", "link": "/mail" },
16+
{ "text": "Custom Processors", "link": "/processors" },
17+
{ "text": "Running Workers", "link": "/workers" }
18+
]
19+
},
20+
{
21+
"text": "Operations",
22+
"collapsed": false,
23+
"items": [
24+
{ "text": "Failed Jobs", "link": "/failed-jobs" },
25+
{ "text": "Worker Events", "link": "/events" }
26+
]
27+
}
28+
]
29+
}

docs/config/__init__.py

Whitespace-only changes.

docs/config/all.py

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

0 commit comments

Comments
 (0)