diff --git a/AGENTS.md b/AGENTS.md index e78a8cc..71871cf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,9 +20,9 @@ not for the public pages. See `docs/design-principles.md` for the design. - Avoid running the server yourself, ask the user to test - `app.py` — the FastAPI app. FastAPI's built-in API docs are disabled (`docs_url`/`redoc_url`/`openapi_url=None`) because `/docs` belongs to - our content. Our own routes (content pages, `/_api/...`, `/_f/...`, - `/_admin`) are registered BEFORE `frontend.route(app, "/")` is - called: fastapi-vue inserts its file routes at the position where + our content. Our own routes (content pages, `/_api/...`, `/_f/...`) are + registered BEFORE `frontend.route(app, "/")` is called: fastapi-vue + inserts its file routes at the position where `route()` was called (during `load()` in the lifespan), so anything defined earlier wins. The one exception is the content catch-all `/{path:path}`, registered AFTER `frontend.route()` so that built @@ -115,17 +115,17 @@ not for the public pages. See `docs/design-principles.md` for the design. two pens swap the docked panel for the other editor; clicking the open editor's own pen closes it. Normally dynamic-imported onto the content page by pagerite.js when a 🖊️ edit link is clicked (the link carries - `data-editor-src`/`data-editor-css`/`data-editor-mode`); the `/_admin` - route (page selected by location hash) is the no-JS-import fallback shell - rendered by `views.render_editor` and keeps its own preview pane. + `data-editor-src`/`data-editor-css`/`data-editor-mode`). In dev, modules load from the Vite dev server (`PAGERITE_VITE_URL`), in prod from the hashed build assets resolved via - `frontend-build/.vite/manifest.json`. `vite.config.js` builds with - `manifest: true`, `assetsDir: '_/assets'` (so the build mirrors the URL - space; `frontend/public/favicon.ico` lands at the build root and is - served at `/favicon.ico`) and JS inputs (`src/main.js` and - `src/pagerite.js`) so no `index.html` ends up in the build (it would shadow - `/`). All outputs are ES modules. vite-plugin-fastapi.js has an + `frontend-build/.vite/manifest.json`. `vite.config.js` sets + `appType: 'mpa'` (no SPA fallback) and builds with `manifest: true`, + `assetsDir: '_/assets'` (so the build mirrors the URL space; + `frontend/public/favicon.ico` lands at the build root and is served at + `/favicon.ico`). JS inputs are `src/main.js` and `src/pagerite.js`; there + is no `index.html` source (it would shadow `/` and turn missing dev paths + into an empty Vue shell). All outputs are ES modules. + vite-plugin-fastapi.js has an auto-upgrade marker — edit `vite.config.js`, not the plugin. - `docs/` — design documentation. @@ -172,7 +172,7 @@ not for the public pages. See `docs/design-principles.md` for the design. - Keep dependencies minimal; add via `uv add` and mention it. - The public URL space belongs to content (pretty slugs at root). Reserve - only `/_` for the machinery (`/_api/`, `/_f/`, `/_assets/`, `/_admin`), plus + only `/_` for the machinery (`/_api/`, `/_f/`, `/_assets/`), plus `/favicon.ico` from the build. Slugs are lowercase ASCII letters, digits, hyphens and underscores `[a-z0-9_-]` (the site editor filters input live via `slugify.js`, built on the `transliteration` npm package — unicode diff --git a/docs/design-principles.md b/docs/design-principles.md index a485f05..09d6613 100644 --- a/docs/design-principles.md +++ b/docs/design-principles.md @@ -10,9 +10,8 @@ evolves. Python with **html5tagger**. There is no client-side templating or SPA for the public site. - **Vue only where interactivity demands it.** Small interactive islands - (editing tools mainly) may be Vue components, either mounted into specific - elements of the server-rendered pages or served as standalone apps - (e.g. an admin panel). The public reading experience has no scripting + (editing tools mainly) are Vue components mounted into specific elements of + the server-rendered pages. The public reading experience has no scripting requirement. - **Persistence via kanta.** Content is stored in an asyncio-friendly kanta database. Rendering happens on the fly on each request — there are no @@ -29,7 +28,7 @@ evolves. directly at the site root; structured content may nest (`/docs/design-principles`-style). The URL space is the author's, so reserved prefixes must be kept few and deliberate: everything internal - lives under `/_` (`/_api/`, `/_f/`, `/_assets/`, `/_admin`). The only + lives under `/_` (`/_api/`, `/_f/`, `/_assets/`). The only other reserved root path is `/favicon.ico`, served from the build. Slugs are lowercase ASCII letters, digits, hyphens and underscores (`[a-z0-9_-]`; input is transliterated and filtered as you type, and a @@ -159,8 +158,7 @@ evolves. reloads the page). The pens are `