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
75 changes: 75 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy Documentation

on:
push:
branches: [ main ]
paths:
- 'apps/docs/**'
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.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build documentation
run: pnpm --filter nginx-love-docs build

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

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

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vitepress/cache/
231 changes: 231 additions & 0 deletions apps/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'nginx-love Documentation',
description: 'Enterprise Nginx + ModSecurity Management Platform',
lang: 'en-US',

// Theme appearance
appearance: 'dark',

// SEO Configuration
head: [
['meta', { name: 'keywords', content: 'nginx, modsecurity, enterprise, security, web server, management platform' }],
['meta', { name: 'author', content: 'nginx-love team' }],
['meta', { property: 'og:title', content: 'nginx-love Documentation' }],
['meta', { property: 'og:description', content: 'Enterprise Nginx + ModSecurity Management Platform' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:image', content: '/og-image.png' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:title', content: 'nginx-love Documentation' }],
['meta', { name: 'twitter:description', content: 'Enterprise Nginx + ModSecurity Management Platform' }],
['meta', { name: 'twitter:image', content: '/og-image.png' }],
['link', { rel: 'icon', href: '/favicon.ico' }]
],

themeConfig: {
// Enhanced navigation with dropdown menus
nav: [
{ text: 'Home', link: '/' },
{
text: 'Documentation',
items: [
{ text: 'Getting Started', link: '/guide/introduction' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick Start', link: '/guide/quick-start' }
]
},
{
text: 'Features',
items: [
{ text: 'Domain Management', link: '/guide/domains' },
{ text: 'SSL Management', link: '/guide/ssl' },
{ text: 'ModSecurity', link: '/guide/modsecurity' },
{ text: 'Performance', link: '/guide/performance' },
{ text: 'Log Analysis', link: '/guide/logs' }
]
},
{
text: 'API Reference',
items: [
{ text: 'Authentication', link: '/api/auth' },
{ text: 'Domains', link: '/api/domains' },
{ text: 'SSL', link: '/api/ssl' },
{ text: 'ModSecurity', link: '/api/modsecurity' },
{ text: 'Performance', link: '/api/performance' },
{ text: 'Logs', link: '/api/logs' },
{ text: 'Users', link: '/api/users' }
]
},
{
text: 'Resources',
items: [
{ text: 'Configuration', link: '/reference/configuration' },
{ text: 'Troubleshooting', link: '/reference/troubleshooting' },
{ text: 'FAQ', link: '/reference/faq' }
]
}
],

// Enhanced sidebar with collapsible sections
sidebar: {
'/guide/': [
{
text: 'Getting Started',
collapsed: false,
items: [
{ text: 'Introduction', link: '/guide/introduction' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick Start', link: '/guide/quick-start' }
]
},
{
text: 'Core Features',
collapsed: false,
items: [
{ text: 'Domain Management', link: '/guide/domains' },
{ text: 'SSL Management', link: '/guide/ssl' },
{ text: 'ModSecurity', link: '/guide/modsecurity' },
{ text: 'Performance Monitoring', link: '/guide/performance' },
{ text: 'Log Analysis', link: '/guide/logs' }
]
}
],
'/api/': [
{
text: 'Authentication',
collapsed: false,
items: [
{ text: 'Overview', link: '/api/auth' }
]
},
{
text: 'Domain Management',
collapsed: false,
items: [
{ text: 'API Reference', link: '/api/domains' }
]
},
{
text: 'SSL Management',
collapsed: false,
items: [
{ text: 'API Reference', link: '/api/ssl' }
]
},
{
text: 'Security',
collapsed: false,
items: [
{ text: 'ModSecurity', link: '/api/modsecurity' }
]
},
{
text: 'Monitoring',
collapsed: false,
items: [
{ text: 'Performance', link: '/api/performance' },
{ text: 'Logs', link: '/api/logs' }
]
},
{
text: 'User Management',
collapsed: false,
items: [
{ text: 'API Reference', link: '/api/users' }
]
}
],
'/reference/': [
{
text: 'Reference',
collapsed: false,
items: [
{ text: 'Configuration', link: '/reference/configuration' },
{ text: 'Troubleshooting', link: '/reference/troubleshooting' },
{ text: 'FAQ', link: '/reference/faq' }
]
}
]
},

// Search configuration
search: {
provider: 'local',
},

// Edit link configuration
editLink: {
pattern: 'https://github.com/nginx-love/nginx-love/edit/main/apps/docs/:path',
text: 'Edit this page on GitHub'
},

// Enhanced social links
socialLinks: [
{ icon: 'github', link: 'https://github.com/TinyActive/nginx-love' },
],

// Enhanced footer
footer: {
message: 'Released under the Apache 2.0 License.',
copyright: `Copyright © 2025-${new Date().getFullYear()} nginx-love`
},

// Custom theme colors
// Note: appearance is now set at the root level

// Additional configurations
outline: {
label: 'Page navigation',
level: [2, 3]
},

// Table of contents
docFooter: {
prev: 'Previous page',
next: 'Next page'
},

// Return to top button
returnToTopLabel: 'Back to top',

// External link indicator
externalLinkIcon: true,

// Last updated text
lastUpdated: {
text: 'Last updated',
formatOptions: {
dateStyle: 'short',
timeStyle: 'medium'
}
}
},

// Markdown configuration
markdown: {
theme: {
light: 'github-light',
dark: 'github-dark'
},
lineNumbers: true,
config: (md) => {
// Add any markdown-it plugins here
}
},

// Vite configuration
vite: {
define: {
__VUE_OPTIONS_API__: false
},
server: {
host: true,
port: 5173
},
build: {
minify: 'terser',
chunkSizeWarningLimit: 1000
}
}
})
Loading