Skip to content

Commit 730ae56

Browse files
committed
Migrate docs to VitePress
- Reorganize docs/ into guide/, authentication/, authorization/ with kebab-case file names - Split the README's mixed concerns (overview, install, troubleshooting, upgrade) into dedicated guide pages - Add new 5-min quick-start with the smallest working two-INI-file setup - Add VitePress config with sidebar groups, top nav, local search, sitemap, lastUpdated, brand-colored theme, and SVG padlock logo - Add GitHub Pages deploy workflow building from docs/ on push to master - Move CONTRIBUTING.md to repo root for GitHub auto-link - Add docs URL to composer.json support metadata - Update root README.md to point to https://dereuromark.github.io/cakephp-tinyauth/
1 parent 4ae2d03 commit 730ae56

31 files changed

Lines changed: 2908 additions & 223 deletions

.github/workflows/deploy-docs.yml

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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ composer.phar
77
logs/
88
.idea/
99
.phpcs.cache
10+
11+
/docs/node_modules/
12+
/docs/.vitepress/cache/
13+
/docs/.vitepress/dist/

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contributing
2+
3+
Feel free to fork and pull request.
4+
5+
There are a few guidelines:
6+
7+
- Coding standards passing: `composer cs-check` to check and `composer cs-fix` to fix.
8+
- Tests passing: `composer test` to run them.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,6 @@ bin/cake plugin load TinyAuth
152152
```
153153

154154
## Docs
155-
For setup and usage see [Docs](/docs).
155+
Full documentation: https://dereuromark.github.io/cakephp-tinyauth/
156156

157157
Also note the original [blog post](https://www.dereuromark.de/2011/12/18/tinyauth-the-fastest-and-easiest-authorization-for-cake2/) and how it all started.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
],
2424
"homepage": "https://github.com/dereuromark/cakephp-tinyauth",
2525
"support": {
26-
"source": "https://github.com/dereuromark/cakephp-tinyauth"
26+
"source": "https://github.com/dereuromark/cakephp-tinyauth",
27+
"docs": "https://dereuromark.github.io/cakephp-tinyauth/"
2728
},
2829
"require": {
2930
"php": ">=8.2",

docs/.vitepress/config.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
function unifiedSidebar() {
4+
return [
5+
{
6+
text: 'Getting Started',
7+
collapsed: false,
8+
items: [
9+
{ text: 'Overview', link: '/guide/' },
10+
{ text: '5-min Quick Start', link: '/guide/quick-start' },
11+
{ text: 'Installation', link: '/guide/install' },
12+
{ text: 'Configuration', link: '/guide/configuration' },
13+
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
14+
{ text: 'Upgrade Guide', link: '/guide/upgrade' },
15+
],
16+
},
17+
{
18+
text: 'Authentication',
19+
collapsed: false,
20+
items: [
21+
{ text: 'Setup & INI', link: '/authentication/' },
22+
{ text: 'Custom Adapter', link: '/authentication/adapter' },
23+
],
24+
},
25+
{
26+
text: 'Authorization',
27+
collapsed: false,
28+
items: [
29+
{ text: 'Setup & INI', link: '/authorization/' },
30+
{ text: 'Custom Adapter', link: '/authorization/adapter' },
31+
{ text: 'Multi-Role', link: '/authorization/multi-role' },
32+
],
33+
},
34+
{
35+
text: 'Helpers & Tools',
36+
collapsed: false,
37+
items: [
38+
{ text: 'AuthUser (Component / Helper)', link: '/auth-user' },
39+
{ text: 'AuthPanel (DebugKit)', link: '/auth-panel' },
40+
],
41+
},
42+
]
43+
}
44+
45+
export default defineConfig({
46+
title: 'cakephp-tinyauth',
47+
description: 'INI-based authentication and authorization for CakePHP — a thin wrapper over the official Authentication and Authorization plugins.',
48+
base: '/cakephp-tinyauth/',
49+
lastUpdated: true,
50+
sitemap: {
51+
hostname: 'https://dereuromark.github.io/cakephp-tinyauth/',
52+
},
53+
head: [
54+
['link', { rel: 'icon', href: '/cakephp-tinyauth/favicon.svg', type: 'image/svg+xml' }],
55+
],
56+
themeConfig: {
57+
logo: '/logo.svg',
58+
nav: [
59+
{ text: 'Guide', link: '/guide/', activeMatch: '/guide/' },
60+
{ text: 'Authentication', link: '/authentication/', activeMatch: '/authentication/' },
61+
{ text: 'Authorization', link: '/authorization/', activeMatch: '/authorization/' },
62+
{
63+
text: 'Links',
64+
items: [
65+
{ text: 'GitHub', link: 'https://github.com/dereuromark/cakephp-tinyauth' },
66+
{ text: 'Packagist', link: 'https://packagist.org/packages/dereuromark/cakephp-tinyauth' },
67+
{ text: 'Issues', link: 'https://github.com/dereuromark/cakephp-tinyauth/issues' },
68+
{ text: 'TinyAuth Backend (admin GUI)', link: 'https://github.com/dereuromark/cakephp-tinyauth-backend' },
69+
],
70+
},
71+
],
72+
sidebar: {
73+
'/': unifiedSidebar(),
74+
},
75+
socialLinks: [
76+
{ icon: 'github', link: 'https://github.com/dereuromark/cakephp-tinyauth' },
77+
],
78+
search: {
79+
provider: 'local',
80+
},
81+
editLink: {
82+
pattern: 'https://github.com/dereuromark/cakephp-tinyauth/edit/master/docs/:path',
83+
text: 'Edit this page on GitHub',
84+
},
85+
footer: {
86+
message: 'Released under the MIT License.',
87+
copyright: 'Copyright Mark Scherer',
88+
},
89+
},
90+
})

docs/.vitepress/theme/custom.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:root {
2+
--vp-c-brand-1: #4338ca;
3+
--vp-c-brand-2: #4f46e5;
4+
--vp-c-brand-3: #6366f1;
5+
--vp-c-brand-soft: rgba(79, 70, 229, 0.14);
6+
7+
--vp-home-hero-name-color: transparent;
8+
--vp-home-hero-name-background: linear-gradient(135deg, #4338ca 0%, #0ea5e9 100%);
9+
--vp-home-hero-image-background-image: linear-gradient(135deg, #4338ca 0%, #0ea5e9 100%);
10+
--vp-home-hero-image-filter: blur(42px);
11+
}
12+
13+
.dark {
14+
--vp-c-brand-1: #818cf8;
15+
--vp-c-brand-2: #6366f1;
16+
--vp-c-brand-3: #4f46e5;
17+
}
18+
19+
.vp-doc table code,
20+
.vp-doc p code,
21+
.vp-doc li code {
22+
white-space: nowrap;
23+
}
24+
25+
.vp-doc .custom-block.tip {
26+
border-color: var(--vp-c-brand-1);
27+
}

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

0 commit comments

Comments
 (0)