From c42c56108ebac6673ec5c86f9f0d51f31e8eb2bd Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 19 Sep 2026 00:04:08 +0300 Subject: Remove the menu fold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header menu no longer folds into a ☰ button: the nav_fold and nav_fold_label options, Layout.Fold/BurgerAt, the burger markup and its checkbox, the fold rules in blog.css and the measuring script on the public page are gone, and the Design tab's preview only sizes its frame again. The public page runs no script of its own once more. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/design.html | 26 +++------------- internal/web/templates/layouts/blog.html | 44 +++++++--------------------- 2 files changed, 14 insertions(+), 56 deletions(-) (limited to 'internal/web/templates') diff --git a/internal/web/templates/dashboard/design.html b/internal/web/templates/dashboard/design.html index 039eabe..1af90c4 100644 --- a/internal/web/templates/dashboard/design.html +++ b/internal/web/templates/dashboard/design.html @@ -158,7 +158,7 @@
-

{{t "When the menu does not fit"}}

-
- - - -
-

{{t "The button sits at the right of the title or logo just above the menu, or in the menu bar itself when nothing is above it, and opens the links as a list. Readers whose browser runs no scripts get it on phones."}}

@@ -380,18 +369,11 @@ .then(function () { pvBusy = false; if (pvAgain) { pvAgain = false; preview(); } }); } function schedule() { clearTimeout(pvTimer); pvTimer = setTimeout(preview, 300); } - function fitFrame() { // the frame runs no scripts, so fold the menu the way the blog's own script does, and size the frame to the header - try { - var d = frame.contentDocument, h = d.querySelector(".site-header.nav-fold"), links = h ? h.querySelectorAll(".site-nav .nav-inner a") : []; - if (links.length) { - h.classList.remove("nav-auto"); h.classList.remove("nav-folded"); - for (var i = 1; i < links.length; i++) if (links[i].offsetTop !== links[0].offsetTop) { h.classList.add("nav-folded"); break; } - } - frame.style.height = d.body.scrollHeight + "px"; - } catch (e) {} + function fitFrame() { // the frame is as tall as the header + try { frame.style.height = frame.contentDocument.body.scrollHeight + "px"; } catch (e) {} } if (frame) { - frame.addEventListener("load", function () { fitFrame(); try { frame.contentDocument.addEventListener("change", fitFrame); } catch (e) {} }); // change: the fold button opened or closed the panel + frame.addEventListener("load", fitFrame); qa("[data-pv]").forEach(function (b) { b.addEventListener("click", function () { frame.classList.toggle("phone", b.getAttribute("data-pv") === "phone"); qa("[data-pv]").forEach(function (o) { o.setAttribute("aria-pressed", String(o === b)); }); diff --git a/internal/web/templates/layouts/blog.html b/internal/web/templates/layouts/blog.html index 71a62b0..99bb13a 100644 --- a/internal/web/templates/layouts/blog.html +++ b/internal/web/templates/layouts/blog.html @@ -40,36 +40,12 @@ {{end}} -{{/* The header: the banner, then its modules in order. With the menu folding - (Layout.Fold) a hidden checkbox comes first: it is the open/closed state, - so the burger label toggles the menu with no script and in old browsers - (`:checked ~` reaches every block after it). Folding itself is decided by - the script below — any link on a second line means the menu does not fit — - which drops nav-auto, the no-script fallback blog.css folds on phones. */}} -{{define "siteheader"}}{{$l := .Data.layout}}{{$t := .Data.theme}}{{end}} {{define "notices"}}{{if .}}
{{range .}}