From 51ca573ef0c1ce4bd2ef7b7525e5543800fd1988 Mon Sep 17 00:00:00 2001 From: grm Date: Thu, 17 Sep 2026 22:29:43 +0300 Subject: Add a page width: cap the columns at so many pixels, centred or at the left MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header's and footer's text follows the cap when they already follow the main column; their backgrounds stay full width. The inset that lines them up with the main column is now exact — the wrap's 1em plus the column's share of the wrap's content box — and, with a page width, uses min() so it is right whether the page or the screen is the narrower. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- AGENTS.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md index 4cf36a3..8459d6d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -240,11 +240,16 @@ internal/web/ server.go (host router, middleware, render helpers) laid out only when it has modules, or always with `theme.keep_columns` (`HasLeft/HasRight` → `body.has-*` classes; column widths in the theme CSS under `@media (min-width: 701px)`). - The page is always full width — there is no content max-width; the - column percentages divide the page and `keep_columns` is how a blogger - gets a narrower, centred main column, with `align_to_main` insetting the - header's and footer's `.wrap`s by the column widths (`calc(1em + N%)`, - wide screens only, backgrounds untouched) so they line up with it; + The page is the screen's width unless `page_width` (pixels, 0 = screen, + clamped 400–3000) caps `.wrap.body-wrap` with `max-width`, centred or at + the left per `page_align` (`Theme.PageMargin`); the column percentages + divide the page either way and `keep_columns` is how a blogger gets a + narrower main column. `align_to_main` insets the header's and footer's + `.wrap`s to the main column's edges (`Theme.Inset`: the wrap's 1em plus + the column's share of the wrap's content box, `calc((1-2w/100)em + w%)`; + with a page width those wraps get the same `max-width`/margin and the + share is `min(w%, w% of the page width)`, the px value alone first for + browsers without `min()` — wide screens only, backgrounds untouched); below 700px `.cols` becomes block flow so the order is main → left → right → footer. Everything is rendered by the `module` template in `layouts/blog.html`. New blogs get `insertDefaultModules` (title + menu -- cgit v1.2.3