diff options
| author | grm <grm@eyesin.space> | 2026-09-18 11:22:25 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-18 11:22:25 +0300 |
| commit | ac125593efe689fabd1e48a7023249c8973698b8 (patch) | |
| tree | d7ee62adfd2260427383093ddf9956b2ef672598 /AGENTS.md | |
| parent | ad30b38759dc222a7137598559998acbd0c06740 (diff) | |
| download | blogspace-ac125593efe689fabd1e48a7023249c8973698b8.tar.gz blogspace-ac125593efe689fabd1e48a7023249c8973698b8.tar.bz2 blogspace-ac125593efe689fabd1e48a7023249c8973698b8.zip | |
Add switches to keep announcements off a page or off post pages
Announcements showed on every public page. Now each page has a "Show
announcements on this page" checkbox (pages.show_notices, on by default)
that covers the page and its posts, and the Design tab's Content section
has "Show announcements on post pages" (theme.post_notices, on by default)
for bloggers who want notices only on listings, not while reading a post.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -363,7 +363,13 @@ internal/web/ server.go (host router, middleware, render helpers) constraint, so a new style needs a migration), `enabled` and `sort_order`. `blogView` loads the enabled ones and `placeNotices` groups them by placement, moving ones for a side column that is not laid - out into the main column. + out into the main column. Two switches hide them: `pages.show_notices` + (`Page.ShowNotices`, the page form's "Show announcements on this page", + default on) covers the page and its posts, and `theme.post_notices` + (`PostNotices`, Design → Content, default on) covers every post page — + `renderPage`/`handleBlogPost` put `noNotices` (a typed empty map, so the + layout's `index` lookups still work) in `notices` instead. Tag, search + and 404 pages always show them. Rendered by the `notices` template in `layouts/blog.html` inside a `.notices` wrapper; CSS classes `notice notice-<style>` use translucent colours so they fit any theme, except `gizmo`: a box framed in the theme's @@ -478,7 +484,7 @@ superadmin password to `admin`. Production refuses both. `-- +goose Up/Down` sections; they run automatically at startup. Never edit an applied migration. Blog chain so far: `00001_init`, `00002_language`, `00003_files`, `00004_tags`, `00005_search`, `00006_format`, `00007_post_image`, - `00008_page_outro`, `00009_gizmo_style`, `00010_font_kind`, `00011_post_hide_date`; control: `00001_init`, `00002_upload_limit`. Both chains were re-baselined at 00001 after + `00008_page_outro`, `00009_gizmo_style`, `00010_font_kind`, `00011_post_hide_date`, `00012_page_show_notices`; control: `00001_init`, `00002_upload_limit`. Both chains were re-baselined at 00001 after the move to per-blog databases; deployments from before it have `goose_db_version` rows 2–7 in the control DB that must be deleted once (README "Upgrading from a single database") or the next control migration |
