From ac125593efe689fabd1e48a7023249c8973698b8 Mon Sep 17 00:00:00 2001 From: grm Date: Fri, 18 Sep 2026 11:22:25 +0300 Subject: 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 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/theme.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/web/theme.go') diff --git a/internal/web/theme.go b/internal/web/theme.go index 676a01e..0437f51 100644 --- a/internal/web/theme.go +++ b/internal/web/theme.go @@ -55,6 +55,7 @@ type Theme struct { PostImage string `json:"post_image"` // where the post page shows the featured image: top | bottom | list (listings only) TitleRule string `json:"title_rule"` // none | line | dots | dots2 | stripes, drawn under page and post titles in the link colour TagHash bool `json:"tag_hash"` // tags are listed as #name + PostNotices bool `json:"post_notices"` // announcements are shown on post pages too, not only on listings FooterBg string `json:"footer_bg"` FooterColor string `json:"footer_color"` @@ -108,7 +109,7 @@ func DefaultTheme() Theme { Font: "sans", HeadingFont: "same", FontSize: "normal", HeaderImageHeight: "medium", HeaderAlign: "left", HeaderBg: "#2f3a4a", HeaderText: "#ffffff", TitleSize: "normal", HeaderRule: "none", NavAlign: "left", NavStyle: "normal", NavBg: "#ffffff", NavText: "#222222", - ShowDates: true, DateFormat: "long", PostsPerPage: postsPerPageChoices[0], ListStyle: "full", PostImage: "top", TitleRule: "none", + ShowDates: true, DateFormat: "long", PostsPerPage: postsPerPageChoices[0], ListStyle: "full", PostImage: "top", TitleRule: "none", PostNotices: true, FooterBg: "#2f3a4a", FooterColor: "#d0d5dc", FooterAlign: "center", LogoSize: "medium", HeaderOn: true, LeftOn: true, RightOn: true, FooterOn: true, LeftWidth: 25, RightWidth: 25, PageAlign: "center", @@ -269,6 +270,7 @@ func ThemeFromForm(cur Theme, f url.Values) Theme { t.PostImage = get("post_image") t.TitleRule = get("title_rule") t.TagHash = on("tag_hash") + t.PostNotices = on("post_notices") t.FooterBg = get("footer_bg") t.FooterColor = get("footer_color") t.FooterAlign = get("footer_align") -- cgit v1.2.3