feat(docs): standalone docs site chrome + category/subcategory navigation

Docs pages no longer embed the app Header (whose hx-post login form silently
degraded to a native GET, leaking credentials into the URL — this page never
loaded htmx). New docs-owned topbar: search, theme picker, Open App; anonymous
visitors get a plain /login link. Optional-auth middleware (hand-rolled —
echojwt's ErrorHandler return ends the chain, producing empty 200s) populates
the user for signed-in visitors.

Navigation rebuilt from the docs directory tree: 6 sections, subcategory
groups, server-rendered expansion and active states. Search results are a
templ partial (/docs/search/partial); code highlighting is server-side chroma
(previously dead hljs CSS); prose is theme-aware via typography DEFAULT vars
(prose-invert painted unreadable text under light themes). /docs renders the
index directly; standalone 404 without the tailwind CDN.

Tests: navigation routing/expansion (internal/docs), render pins asserting no
login form/password field/app sidebar ever return on docs pages.
lint-rendering: exempt *.test.ts fixtures (jsdom DOM building); docs.ts
baseline 5 -> 1.
This commit is contained in:
John O'Keefe committed 2026-10-24 14:31:36 -04:00
1 parent 9d0ae2bcc4
commit 84cd6328f4
19 files changed
+2030 -1097

No files matched your search

+20 -1
View File
@@ -118,9 +118,28 @@ const config: Config = {
"wood-mahogany": "url('/static/textures/wood-mahogany.png')",
},
typography: ({ theme }) => ({
invert: {
// Docs pages use plain `prose`; bind its palette to the theme
// variables so markdown renders correctly under dark AND light
// themes (the old layout hardcoded prose-invert, which painted
// light-on-dark text even under light themes).
DEFAULT: {
css: {
"--tw-prose-body": "var(--text-primary)",
"--tw-prose-headings": "var(--text-primary)",
"--tw-prose-lead": "var(--text-secondary)",
"--tw-prose-links": "var(--accent)",
"--tw-prose-bold": "var(--text-primary)",
"--tw-prose-counters": "var(--text-secondary)",
"--tw-prose-bullets": "var(--accent)",
"--tw-prose-hr": "var(--border)",
"--tw-prose-quotes": "var(--text-secondary)",
"--tw-prose-quote-borders": "var(--accent)",
"--tw-prose-captions": "var(--text-secondary)",
"--tw-prose-code": "var(--text-primary)",
"--tw-prose-pre-code": "var(--text-primary)",
"--tw-prose-pre-bg": "var(--bg-secondary)",
"--tw-prose-th-borders": "var(--border)",
"--tw-prose-td-borders": "var(--border)",
code: {
backgroundColor: "var(--bg-primary)",
color: "var(--text-primary)",