docs: restructure with Build/Publish sections and dynamic nav
- Move PHP and Go framework docs from /packages/ to /build/ - Move CLI docs from /packages/go/cmd/ to /build/cli/ - Add /publish/ section with docs for all release publishers: GitHub, Docker, npm, Homebrew, Scoop, AUR, Chocolatey, LinuxKit - Add sidebar navigation for /publish/ section - Update nav with Build, Publish, Deploy dropdowns - Remove changelog, contributing, guide, and security sections - Make sidebar auto-discover from packages, build, publish, deploy dirs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
421d4ae0cd
commit
f831fd6846
125 changed files with 862 additions and 1648 deletions
|
|
@ -6,17 +6,10 @@ import { getPackagesSidebar, getPackagesNav } from './sidebar.js'
|
|||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
const docsDir = path.resolve(__dirname, '..')
|
||||
|
||||
// Auto-discover packages
|
||||
// Auto-discover packages and build items
|
||||
const packagesSidebar = getPackagesSidebar(docsDir)
|
||||
const packagesNav = getPackagesNav(docsDir)
|
||||
|
||||
// Separate PHP/Go from ecosystem packages for nav
|
||||
const phpNav = packagesNav.find(p => p.link === '/packages/php/')
|
||||
const goNav = packagesNav.find(p => p.link === '/packages/go/')
|
||||
const ecosystemNav = packagesNav.filter(p =>
|
||||
p.link !== '/packages/php/' && p.link !== '/packages/go/'
|
||||
)
|
||||
|
||||
export default defineConfig({
|
||||
title: 'Host UK',
|
||||
description: 'Native application frameworks for PHP and Go',
|
||||
|
|
@ -27,71 +20,74 @@ export default defineConfig({
|
|||
/^https?:\/\/localhost/,
|
||||
// Old paths during migration
|
||||
/\/packages\/core/,
|
||||
/\/packages\/(php|go)/,
|
||||
/\/core\//,
|
||||
/\/architecture\//,
|
||||
/\/patterns-guide\//,
|
||||
// Security pages not yet created
|
||||
/\/security\/(api-authentication|rate-limiting|workspace-isolation|sql-validation|gdpr)/,
|
||||
// Security pages moved to /build/php/
|
||||
/\/security\//,
|
||||
// Package pages not yet created
|
||||
/\/packages\/admin\/(tables|security|hlcrf|activity)/,
|
||||
/\/packages\/api\/(openapi|analytics|alerts|logging)/,
|
||||
/\/packages\/mcp\/commerce/,
|
||||
/\/packages\/php\/(services|seeders|security|email-shield|action-gate|i18n)/,
|
||||
/\/build\/php\/(services|seeders|security|email-shield|action-gate|i18n)/,
|
||||
// Package root links (without trailing slash) - VitePress resolves these
|
||||
/^\/packages\/(admin|api|mcp|php|go)$/,
|
||||
/^\/packages\/(admin|api|mcp|php|go)#/,
|
||||
/^\/packages\/(admin|api|mcp|tenant|commerce|content|developer)$/,
|
||||
/^\/packages\/(admin|api|mcp|tenant|commerce|content|developer)#/,
|
||||
/^\/build\/(php|go)$/,
|
||||
/^\/build\/(php|go)#/,
|
||||
// Guide moved to /build/php/
|
||||
/\/guide\//,
|
||||
// Other pages not yet created
|
||||
/\/testing\//,
|
||||
/\/changelog/,
|
||||
/\/contributing/,
|
||||
/\/guide\/testing/,
|
||||
// Go docs - relative paths
|
||||
// Go docs - relative paths (cmd moved to /build/cli/)
|
||||
/\.\.\/configuration/,
|
||||
/\.\.\/examples/,
|
||||
/\.\/cmd\//,
|
||||
],
|
||||
|
||||
themeConfig: {
|
||||
logo: '/logo.svg',
|
||||
|
||||
nav: [
|
||||
{ text: 'Guide', link: '/guide/getting-started' },
|
||||
{
|
||||
text: 'PHP',
|
||||
link: '/packages/php/',
|
||||
activeMatch: '/packages/php/'
|
||||
text: 'Build',
|
||||
activeMatch: '/build/',
|
||||
items: [
|
||||
{ text: 'PHP', link: '/build/php/' },
|
||||
{ text: 'Go', link: '/build/go/' },
|
||||
{ text: 'CLI', link: '/build/cli/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Go',
|
||||
link: '/packages/go/',
|
||||
activeMatch: '/packages/go/'
|
||||
text: 'Publish',
|
||||
activeMatch: '/publish/',
|
||||
items: [
|
||||
{ text: 'Overview', link: '/publish/' },
|
||||
{ text: 'GitHub', link: '/publish/github' },
|
||||
{ text: 'Docker', link: '/publish/docker' },
|
||||
{ text: 'npm', link: '/publish/npm' },
|
||||
{ text: 'Homebrew', link: '/publish/homebrew' },
|
||||
{ text: 'Scoop', link: '/publish/scoop' },
|
||||
{ text: 'AUR', link: '/publish/aur' },
|
||||
{ text: 'Chocolatey', link: '/publish/chocolatey' },
|
||||
{ text: 'LinuxKit', link: '/publish/linuxkit' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Deploy',
|
||||
activeMatch: '/deploy/',
|
||||
items: []
|
||||
},
|
||||
{
|
||||
text: 'Packages',
|
||||
items: ecosystemNav
|
||||
},
|
||||
{ text: 'Security', link: '/security/overview' },
|
||||
{
|
||||
text: 'v1.0',
|
||||
items: [
|
||||
{ text: 'Changelog', link: '/changelog' },
|
||||
{ text: 'Contributing', link: '/contributing' }
|
||||
]
|
||||
items: packagesNav
|
||||
}
|
||||
],
|
||||
|
||||
sidebar: {
|
||||
'/guide/': [
|
||||
{
|
||||
text: 'Introduction',
|
||||
items: [
|
||||
{ text: 'Getting Started', link: '/guide/getting-started' },
|
||||
{ text: 'Installation', link: '/guide/installation' },
|
||||
{ text: 'Configuration', link: '/guide/configuration' },
|
||||
{ text: 'Quick Start', link: '/guide/quick-start' },
|
||||
{ text: 'Testing', link: '/guide/testing' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
// Packages index
|
||||
'/packages/': [
|
||||
{
|
||||
|
|
@ -100,21 +96,27 @@ export default defineConfig({
|
|||
}
|
||||
],
|
||||
|
||||
// Auto-discovered package sidebars (php, go, admin, api, mcp, etc.)
|
||||
...packagesSidebar,
|
||||
|
||||
'/security/': [
|
||||
// Publish section
|
||||
'/publish/': [
|
||||
{
|
||||
text: 'Security',
|
||||
text: 'Publish',
|
||||
items: [
|
||||
{ text: 'Overview', link: '/security/overview' },
|
||||
{ text: 'Namespaces & Entitlements', link: '/security/namespaces' },
|
||||
{ text: 'Changelog', link: '/security/changelog' },
|
||||
{ text: 'Responsible Disclosure', link: '/security/responsible-disclosure' }
|
||||
{ text: 'Overview', link: '/publish/' },
|
||||
{ text: 'GitHub', link: '/publish/github' },
|
||||
{ text: 'Docker', link: '/publish/docker' },
|
||||
{ text: 'npm', link: '/publish/npm' },
|
||||
{ text: 'Homebrew', link: '/publish/homebrew' },
|
||||
{ text: 'Scoop', link: '/publish/scoop' },
|
||||
{ text: 'AUR', link: '/publish/aur' },
|
||||
{ text: 'Chocolatey', link: '/publish/chocolatey' },
|
||||
{ text: 'LinuxKit', link: '/publish/linuxkit' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
// Auto-discovered package sidebars (php, go, admin, api, mcp, etc.)
|
||||
...packagesSidebar,
|
||||
|
||||
'/api/': [
|
||||
{
|
||||
text: 'API Reference',
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import fs from 'fs'
|
|||
import path from 'path'
|
||||
import matter from 'gray-matter'
|
||||
|
||||
// Auto-discover packages from docs/packages/
|
||||
// Auto-discover packages from docs/packages/ and docs/build/
|
||||
// Each package folder should have an index.md
|
||||
//
|
||||
// Frontmatter options:
|
||||
|
|
@ -12,23 +12,32 @@ import matter from 'gray-matter'
|
|||
// collapsed: true - Start group collapsed (for directories)
|
||||
|
||||
export function getPackagesSidebar(docsDir) {
|
||||
const packagesDir = path.join(docsDir, 'packages')
|
||||
return {
|
||||
...getSidebarForDir(docsDir, 'packages'),
|
||||
...getSidebarForDir(docsDir, 'build'),
|
||||
...getSidebarForDir(docsDir, 'publish'),
|
||||
...getSidebarForDir(docsDir, 'deploy')
|
||||
}
|
||||
}
|
||||
|
||||
if (!fs.existsSync(packagesDir)) {
|
||||
function getSidebarForDir(docsDir, dirName) {
|
||||
const targetDir = path.join(docsDir, dirName)
|
||||
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
return {}
|
||||
}
|
||||
|
||||
const sidebar = {}
|
||||
const packages = fs.readdirSync(packagesDir, { withFileTypes: true })
|
||||
const packages = fs.readdirSync(targetDir, { withFileTypes: true })
|
||||
.filter(d => d.isDirectory())
|
||||
.map(d => d.name)
|
||||
.sort()
|
||||
|
||||
for (const pkg of packages) {
|
||||
const pkgDir = path.join(packagesDir, pkg)
|
||||
const pkgDir = path.join(targetDir, pkg)
|
||||
|
||||
// Build sidebar tree recursively
|
||||
const items = buildSidebarItems(pkgDir, `/packages/${pkg}`)
|
||||
const items = buildSidebarItems(pkgDir, `/${dirName}/${pkg}`)
|
||||
|
||||
if (items.length === 0) continue
|
||||
|
||||
|
|
@ -46,7 +55,7 @@ export function getPackagesSidebar(docsDir) {
|
|||
}
|
||||
}
|
||||
|
||||
sidebar[`/packages/${pkg}/`] = [
|
||||
sidebar[`/${dirName}/${pkg}/`] = [
|
||||
{
|
||||
text: packageTitle,
|
||||
items: items
|
||||
|
|
|
|||
|
|
@ -28,4 +28,4 @@ go install github.com/host-uk/core/cmd/core@latest
|
|||
|
||||
Verify: `core doctor`
|
||||
|
||||
See [Getting Started](../getting-started.md) for all installation options.
|
||||
See [Getting Started](/build/go/getting-started) for all installation options.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Core CLI
|
||||
# Core Go
|
||||
|
||||
Core is a unified CLI for the host-uk ecosystem - build, release, and deploy Go, Wails, PHP, and container workloads.
|
||||
Core is a Go framework for the host-uk ecosystem - build, release, and deploy Go, Wails, PHP, and container workloads.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -20,21 +20,21 @@ See [Getting Started](getting-started.md) for all installation options including
|
|||
|
||||
## Command Reference
|
||||
|
||||
See [cmd/](cmd/) for full command documentation.
|
||||
See [CLI](/build/cli/) for full command documentation.
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| [go](cmd/go/) | Go development (test, fmt, lint, cov) |
|
||||
| [php](cmd/php/) | Laravel/PHP development |
|
||||
| [build](cmd/build/) | Build Go, Wails, Docker, LinuxKit projects |
|
||||
| [ci](cmd/ci/) | Publish releases (dry-run by default) |
|
||||
| [sdk](cmd/sdk/) | SDK generation and validation |
|
||||
| [dev](cmd/dev/) | Multi-repo workflow + dev environment |
|
||||
| [pkg](cmd/pkg/) | Package search and install |
|
||||
| [vm](cmd/vm/) | LinuxKit VM management |
|
||||
| [docs](cmd/docs/) | Documentation management |
|
||||
| [setup](cmd/setup/) | Clone repos from registry |
|
||||
| [doctor](cmd/doctor/) | Check development environment |
|
||||
| [go](/build/cli/go/) | Go development (test, fmt, lint, cov) |
|
||||
| [php](/build/cli/php/) | Laravel/PHP development |
|
||||
| [build](/build/cli/build/) | Build Go, Wails, Docker, LinuxKit projects |
|
||||
| [ci](/build/cli/ci/) | Publish releases (dry-run by default) |
|
||||
| [sdk](/build/cli/sdk/) | SDK generation and validation |
|
||||
| [dev](/build/cli/dev/) | Multi-repo workflow + dev environment |
|
||||
| [pkg](/build/cli/pkg/) | Package search and install |
|
||||
| [vm](/build/cli/vm/) | LinuxKit VM management |
|
||||
| [docs](/build/cli/docs/) | Documentation management |
|
||||
| [setup](/build/cli/setup/) | Clone repos from registry |
|
||||
| [doctor](/build/cli/doctor/) | Check development environment |
|
||||
|
||||
## Quick Start
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue