diff options
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -86,9 +86,27 @@ internal/web/ server.go (host router, middleware, render helpers) value to an allowlist (hex colours, enum strings, uuid image ids) — this is what makes inlining the generated CSS safe. Add new options in the struct, `normalize`, `ThemeFromForm`, the CSS template and - `dashboard/design.html`. + `dashboard/design.html`; defaults must reproduce the look blogs had + before the option existed. Non-CSS options (`ShowDates`, `DateFormat` via + `FormatDate`, `FooterShowRSS`, `Favicon`) are read by the blog templates. + Optional colours (`LinkHover`, `NavHover`) are `""` = inherit and come + from a colour input paired with a `<name>_custom` checkbox. Image fields + use the `imagepick` partial's radios: `none` clears, a uuid selects, no + value keeps (`pickImage`); an upload in `<name>_file` wins. + Options that only apply to one menu layout (`NavAlign` for horizontal + menus, `NavSidebarWidth` for the sidebar) are shown/hidden in + `design.html` with CSS only (`#np-*:checked ~ .only-*` in dashboard.css, + same trick for the `_custom` hover checkboxes) — no JS, and browsers + without `:checked` just show everything. + `Presets()`/`WithPreset` are the colour schemes (`POST /b/{sub}/design/preset`, + colours only); `POST /b/{sub}/design/reset` stores `DefaultTheme()`. +- **Favicon**: `static/favicon.svg` + `favicon.png` are the defaults, linked + from both layouts. A blog can set `theme.favicon` (an image id) which the + blog layout links instead. `GET /favicon.ico` on every host + (`handleFavicon`) serves the png or redirects to the blog's image, so + icon-probing browsers never hit the 404 page; `favicon.ico` is reserved. - **Images**: `/media/{uuid}` served on every host with immutable cache - headers. Uploads are content-sniffed (png/jpeg/gif/webp). Deleting an + headers. Uploads are content-sniffed (png/jpeg/gif/webp/ico). Deleting an image clears theme references to it. `POST /b/{sub}/images/upload` answers JSON (`{id, filename, markdown}` / `{error}`) when the request has `Accept: application/json`; that is what the editor script calls. |
