From b233445a73168994087356d45b5dc7dd6a07aa8e Mon Sep 17 00:00:00 2001 From: grm Date: Thu, 17 Sep 2026 21:37:46 +0300 Subject: Add a rule under page and post titles, and tags shown with a # in front MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two Design tab options in the Posts section. The title rule reuses the header rule's kinds (line, dots, stripes): a body class blog.css draws from — width and style only, so the theme CSS's link colour is not reset — ending at a floated thumbnail instead of running under it. The tag hash is applied everywhere tags are listed: under posts, in both tag modules and in the tag page's title. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/web_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'internal/web/web_test.go') diff --git a/internal/web/web_test.go b/internal/web/web_test.go index 42d29e4..205e42f 100644 --- a/internal/web/web_test.go +++ b/internal/web/web_test.go @@ -133,6 +133,23 @@ func TestThemeNormalizeAndCSS(t *testing.T) { } } +// The rule under titles is a body class blog.css draws from, coloured by the +// theme CSS; the tag hash is a plain flag the templates read. +func TestTitleRuleAndTagHash(t *testing.T) { + th := DefaultTheme() + if th.TitleRuleClass() != "" || th.TagHash || strings.Contains(th.CSS(), ".page-title") { + t.Errorf("defaults: %+v", th) + } + th = ThemeFromForm(th, url.Values{"title_rule": {"dots"}, "tag_hash": {"on"}, "link_color": {"#b03a48"}}) + if th.TitleRuleClass() != "titles-dots" || !th.TagHash || !strings.Contains(th.CSS(), ".page-title, .post-title { border-color:#b03a48; }") { + t.Errorf("from form: %+v\n%s", th, th.CSS()) + } + th = ThemeFromForm(th, url.Values{"title_rule": {"neon"}}) + if th.TitleRuleClass() != "" || th.TagHash { + t.Errorf("junk rule falls back, unticked box is off: %+v", th) + } +} + // An uploaded font is declared as a face and put first in the stack, the // built-in choice behind it; the heading font falls back to the text's stack. func TestCustomFontCSS(t *testing.T) { -- cgit v1.2.3