From dd13e4b73a105ee416b6cfd8eb19b217622c0031 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:33:57 +0300 Subject: Add announcements: blog-wide notices on every page and post A blog can have any number of announcements ("sections" in the schema): a book club's next meeting, this month's pick, a holiday closure. Each has a placement (above or below the posts, or under the menu when the menu is a left sidebar), a look (highlighted, warning, plain), an order, and an on/off switch so recurring notices can be kept around while hidden. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/sections.html | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 internal/web/templates/dashboard/sections.html (limited to 'internal/web/templates/dashboard/sections.html') diff --git a/internal/web/templates/dashboard/sections.html b/internal/web/templates/dashboard/sections.html new file mode 100644 index 0000000..d2fade7 --- /dev/null +++ b/internal/web/templates/dashboard/sections.html @@ -0,0 +1,29 @@ +{{define "title"}}Announcements · {{.Blog.Title}}{{end}} +{{define "content"}} +{{$u := print "/b/" .Blog.Subdomain "/announcements"}} +
+

Announcements

+ +

Notices shown on every page and post of your blog — the next meeting, this month's book, a holiday closure. Hide one instead of deleting it if you will need it again.

+
+
+{{if .Data.sections}} + + + {{range .Data.sections}} + + + + + + {{end}} +
OrderAnnouncementWhereLook
+
+
+
{{if .Title}}{{.Title}}{{else}}(untitled){{end}}{{if not .Enabled}}hidden{{end}}{{if eq .Placement "above"}}Above the posts{{else if eq .Placement "below"}}Below the posts{{else}}Sidebar{{end}}{{if eq .Style "note"}}Highlighted{{else if eq .Style "warning"}}Warning{{else}}Plain{{end}} +
+ delete +
+{{else}}

No announcements yet. Write the first one.

{{end}} +
+{{end}} -- cgit v1.2.3