aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/theme.go
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-18 11:22:25 +0300
committergrm <grm@eyesin.space>2026-09-18 11:22:25 +0300
commitac125593efe689fabd1e48a7023249c8973698b8 (patch)
treed7ee62adfd2260427383093ddf9956b2ef672598 /internal/web/theme.go
parentad30b38759dc222a7137598559998acbd0c06740 (diff)
downloadblogspace-ac125593efe689fabd1e48a7023249c8973698b8.tar.gz
blogspace-ac125593efe689fabd1e48a7023249c8973698b8.tar.bz2
blogspace-ac125593efe689fabd1e48a7023249c8973698b8.zip
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/theme.go')
-rw-r--r--internal/web/theme.go4
1 files changed, 3 insertions, 1 deletions
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")