Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy Documentation

on:
push:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: npm ci
working-directory: docs

- name: Build with VitePress
run: npm run docs:build
working-directory: docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ composer.phar
logs/
.idea/
.phpcs.cache

/docs/node_modules/
/docs/.vitepress/cache/
/docs/.vitepress/dist/
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributing

Feel free to fork and pull request.

There are a few guidelines:

- Coding standards passing: `composer cs-check` to check and `composer cs-fix` to fix.
- Tests passing: `composer test` to run them.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ bin/cake plugin load TinyAuth
```

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

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.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
],
"homepage": "https://github.com/dereuromark/cakephp-tinyauth",
"support": {
"source": "https://github.com/dereuromark/cakephp-tinyauth"
"source": "https://github.com/dereuromark/cakephp-tinyauth",
"docs": "https://dereuromark.github.io/cakephp-tinyauth/"
},
"require": {
"php": ">=8.2",
Expand Down
100 changes: 100 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { defineConfig } from 'vitepress'

function unifiedSidebar() {
return [
{
text: 'Getting Started',
collapsed: false,
items: [
{ text: 'Overview', link: '/guide/' },
{ text: '5-min Quick Start', link: '/guide/quick-start' },
{ text: 'Installation', link: '/guide/install' },
{ text: 'Configuration', link: '/guide/configuration' },
{ text: 'Custom Adapters', link: '/guide/custom-adapters' },
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
{ text: 'Upgrade Guide', link: '/guide/upgrade' },
],
},
{
text: 'Authentication',
collapsed: false,
items: [
{ text: 'Setup & INI', link: '/authentication/' },
{ text: 'Impersonation', link: '/authentication/impersonation' },
{ text: 'Custom Adapter', link: '/authentication/adapter' },
],
},
{
text: 'Authorization',
collapsed: false,
items: [
{ text: 'Setup & INI', link: '/authorization/' },
{ text: 'Middleware & Policy', link: '/authorization/middleware' },
{ text: 'Custom Adapter', link: '/authorization/adapter' },
{ text: 'Multi-Role', link: '/authorization/multi-role' },
],
},
{
text: 'Helpers & Tools',
collapsed: false,
items: [
{ text: 'AuthUser (Component / Helper)', link: '/auth-user' },
{ text: 'AuthPanel (DebugKit)', link: '/auth-panel' },
],
},
{
text: 'Reference',
collapsed: true,
items: [
{ text: 'CLI Commands', link: '/reference/cli' },
],
},
]
}

export default defineConfig({
title: 'cakephp-tinyauth',
description: 'INI-based authentication and authorization for CakePHP — a thin wrapper over the official Authentication and Authorization plugins.',
base: '/cakephp-tinyauth/',
lastUpdated: true,
sitemap: {
hostname: 'https://dereuromark.github.io/cakephp-tinyauth/',
},
head: [
['link', { rel: 'icon', href: '/cakephp-tinyauth/favicon.svg', type: 'image/svg+xml' }],
],
themeConfig: {
logo: '/logo.svg',
nav: [
{ text: 'Guide', link: '/guide/', activeMatch: '/guide/' },
{ text: 'Authentication', link: '/authentication/', activeMatch: '/authentication/' },
{ text: 'Authorization', link: '/authorization/', activeMatch: '/authorization/' },
{
text: 'Links',
items: [
{ text: 'GitHub', link: 'https://github.com/dereuromark/cakephp-tinyauth' },
{ text: 'Packagist', link: 'https://packagist.org/packages/dereuromark/cakephp-tinyauth' },
{ text: 'Issues', link: 'https://github.com/dereuromark/cakephp-tinyauth/issues' },
{ text: 'TinyAuth Backend (admin GUI)', link: 'https://github.com/dereuromark/cakephp-tinyauth-backend' },
],
},
],
sidebar: {
'/': unifiedSidebar(),
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/dereuromark/cakephp-tinyauth' },
],
search: {
provider: 'local',
},
editLink: {
pattern: 'https://github.com/dereuromark/cakephp-tinyauth/edit/master/docs/:path',
text: 'Edit this page on GitHub',
},
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright Mark Scherer',
},
},
})
27 changes: 27 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:root {
--vp-c-brand-1: #4338ca;
--vp-c-brand-2: #4f46e5;
--vp-c-brand-3: #6366f1;
--vp-c-brand-soft: rgba(79, 70, 229, 0.14);

--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: linear-gradient(135deg, #4338ca 0%, #0ea5e9 100%);
--vp-home-hero-image-background-image: linear-gradient(135deg, #4338ca 0%, #0ea5e9 100%);
--vp-home-hero-image-filter: blur(42px);
}

.dark {
--vp-c-brand-1: #818cf8;
--vp-c-brand-2: #6366f1;
--vp-c-brand-3: #4f46e5;
}

.vp-doc table code,
.vp-doc p code,
.vp-doc li code {
white-space: nowrap;
}

.vp-doc .custom-block.tip {
border-color: var(--vp-c-brand-1);
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from 'vitepress/theme'
import './custom.css'

export default DefaultTheme
Loading
Loading