From 63f9fdff6e5bdf6333a4b7813ebeb5b797838b6d Mon Sep 17 00:00:00 2001 From: grm Date: Fri, 18 Sep 2026 19:29:30 +0300 Subject: Fold the header menu into a button when its links do not fit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A long menu wrapped onto two or three lines on phones and narrow windows. With the new Design switch the header menu folds into a ☰ button (an icon, the word Menu, or both) carried by the title or logo block just above it, at the right end of its row, or by the menu bar when nothing is above it; the button opens the links as a stacked list with the search box on top. The open/closed state is a hidden checkbox and the button its label, so opening needs no script and works in old browsers. Whether to fold is decided by a small inline script — any link on a second line means the menu does not fit — re-checked on resize; without it blog.css folds on phones only, and browsers too old for that keep the wrapping menu. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- AGENTS.md | 20 +++++++- README.md | 3 +- internal/i18n/el.go | 12 +++-- internal/web/layout.go | 18 +++++++ internal/web/static/blog.css | 47 +++++++++++++++++ internal/web/templates/dashboard/design.html | 11 ++++ internal/web/templates/layouts/blog.html | 46 +++++++++++++---- internal/web/theme.go | 11 +++- internal/web/web_test.go | 76 +++++++++++++++++++++++++++- 9 files changed, 225 insertions(+), 19 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4628a5a..00a29f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -225,7 +225,8 @@ internal/web/ server.go (host router, middleware, render helpers) unscoped (a column menu's block links centre their text, as before). They replaced a `nav_style` select (`normal` | `uppercase` | `plain`), which `ParseTheme` still decodes and maps onto the switches — `uppercase` was also the small size — (`omitempty`, so - the next save drops it). `TitleRule` (`none` | `line` | `dots` | `dots2` | `stripes`) is the header + the next save drops it). `NavFold` folds the header menu into a button + (`NavFoldLabel`: `icon` | `text` | `both`), see Layout. `TitleRule` (`none` | `line` | `dots` | `dots2` | `stripes`) is the header rule's kinds, plus a double dotted row (`dots2`: the border and an absolutely positioned `::after` with a second one 2px above), under page and post titles (`.page-title`, `.post-title`): a body class from `Theme.TitleRuleClass` (`titles-`) that blog.css draws @@ -296,7 +297,22 @@ internal/web/ server.go (host router, middleware, render helpers) 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 + `layouts/blog.html`; the header by `siteheader` (the banner, then the + modules). **Menu fold** (`theme.nav_fold`, `Layout.Fold`/`BurgerAt` from + `buildLayout`): the header menu turns into a button when its links do not + fit. The button (`burger` template, a `