mcaxl/docs/astro.config.mjs
Ryan Malloy 314a80d6de docs: deployment scaffolding + logos + live cluster examples
Three additions to the docs site, all atomic to docs/:

1. Deployment configs (Dockerfile + Caddyfile + docker-compose.yml +
   .env.example + Makefile) mirroring bingham/cucx's pattern. The
   compose service uses caddy-docker-proxy labels with the operator's
   .mcp.l.supported.systems wildcard DNS pattern; suggested subdomain
   is mcaxl-docs.mcp.l.supported.systems.

2. Logo + favicon (forest-green palette matching the existing custom.css
   accent). Wordmark uses ui-monospace with currentColor so Starlight
   inverts on light/dark; icon-mark is a terminal chevron + three
   diminishing query-row lines (audit-by-query motif).

3. Live cluster examples in reference/tools.md for axl_version,
   axl_list_tables (route% pattern), and axl_describe_table
   (routepartition). Outputs sanitized per python.md PII rules
   (15.0.1.12900(234) → 15.0(1); cluster-fingerprinting build string
   removed).

Build clean: 17 pages built, pagefind search index across all,
favicon resolves to /favicon.svg, logo fingerprinted into _astro/.

Not yet deployed — operator wires docker compose up when ready.
2026-04-29 04:19:20 -06:00

135 lines
3.8 KiB
JavaScript

// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import icon from 'astro-icon';
import mermaid from 'astro-mermaid';
import starlightPageActions from 'starlight-page-actions';
// Reverse-proxy / HMR awareness. `DOMAIN` is injected by docker-compose
// (DEV_DOMAIN for the dev service, DOMAIN for prod). When unset, we
// assume plain local dev on http://localhost:4321.
const DOMAIN = process.env.DOMAIN || 'localhost';
const IS_BEHIND_PROXY = DOMAIN !== 'localhost';
export default defineConfig({
// Disabled per workspace convention.
telemetry: false,
devToolbar: { enabled: false },
site: IS_BEHIND_PROXY ? `https://${DOMAIN}` : undefined,
// Shiki doesn't ship a Cisco IOS grammar. Map `cisco` → `ini` (closest
// visual match — `!` line comments, "keyword value" shape). Silences
// build-time warnings for any Cisco code fences in narrative pages.
// `env` (dotenv files) → `bash` so the KEY=value syntax highlights.
markdown: {
shikiConfig: {
langAlias: {
cisco: 'ini',
env: 'bash',
},
},
},
integrations: [
// Mermaid must come BEFORE starlight — its remark/rehype plugin has
// to register before Starlight sets up its MDX pipeline. Renders
// client-side (no build-time SVG generation).
mermaid({
theme: 'default',
autoTheme: true, // follows light/dark mode toggle
}),
icon({
include: {
lucide: ['*'],
},
}),
starlight({
title: 'mcaxl docs',
description:
'Read-only MCP server for Cisco Unified Communications Manager (CUCM) — AXL SOAP API + RisPort70 audit. Documentation.',
logo: {
src: './src/assets/logo.svg',
replacesTitle: false,
},
favicon: '/favicon.svg',
customCss: ['./src/styles/custom.css'],
// Per-page action buttons: "Copy Markdown" + "View in Markdown"
// (.md route) + "Share" menus. Open-in-AI actions disabled because
// they assume the third-party AI can fetch the URL — fine here for
// a public site, but kept off to match the operator preference for
// copy-and-paste handoffs.
plugins: [
starlightPageActions({
actions: {
chatgpt: false,
claude: false,
},
}),
],
lastUpdated: true,
pagination: true,
social: [
{
icon: 'external',
label: 'PyPI',
href: 'https://pypi.org/project/mcaxl/',
},
{
icon: 'external',
label: 'Gitea repo',
href: 'https://git.supported.systems/mcp/mcaxl',
},
],
editLink: {
baseUrl: 'https://git.supported.systems/mcp/mcaxl/_edit/main/docs/',
},
sidebar: [
{
label: 'Overview',
items: [
{ label: 'Home', link: '/' },
],
},
{
label: 'Getting started',
collapsed: false,
autogenerate: { directory: 'getting-started' },
},
{
label: 'How-to guides',
collapsed: false,
autogenerate: { directory: 'how-to' },
},
{
label: 'Reference',
collapsed: false,
autogenerate: { directory: 'reference' },
},
{
label: 'Explanation',
collapsed: true,
autogenerate: { directory: 'explanation' },
},
],
}),
],
vite: {
server: {
host: '0.0.0.0',
// HMR survives behind a Caddy-terminated TLS reverse proxy when
// configured this way. Leaves localhost dev untouched.
hmr: IS_BEHIND_PROXY
? {
host: DOMAIN,
protocol: 'wss',
clientPort: 443,
}
: undefined,
},
},
});