diff options
| author | grm <grm@eyesin.space> | 2026-09-17 21:42:02 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-17 21:42:02 +0300 |
| commit | 2a347ced1b4ea8c24440f646df35207c3a3597ac (patch) | |
| tree | 2bdfdbb32173172975e576b56bf0636af7462817 /internal/web/handlers_posts.go | |
| parent | b233445a73168994087356d45b5dc7dd6a07aa8e (diff) | |
| download | blogspace-2a347ced1b4ea8c24440f646df35207c3a3597ac.tar.gz blogspace-2a347ced1b4ea8c24440f646df35207c3a3597ac.tar.bz2 blogspace-2a347ced1b4ea8c24440f646df35207c3a3597ac.zip | |
Let a post hide its date
A checkbox on the post form (posts.hide_date) overriding the theme's
"show the date on posts" for that post alone: listings, the post page and
search results leave the date out; the feed keeps its pubDate.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/handlers_posts.go')
| -rw-r--r-- | internal/web/handlers_posts.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/web/handlers_posts.go b/internal/web/handlers_posts.go index ac0dd90..8a54c31 100644 --- a/internal/web/handlers_posts.go +++ b/internal/web/handlers_posts.go @@ -113,6 +113,7 @@ func (s *Server) handlePostSave(w http.ResponseWriter, r *http.Request) { p.BodyMD = strings.ReplaceAll(r.FormValue("body"), "\r\n", "\n") p.Format = pick(r.FormValue("format"), store.FormatMarkdown, store.FormatHTML) p.Published = r.FormValue("published") == "on" + p.HideDate = r.FormValue("hide_date") == "on" p.PageID, _ = strconv.ParseInt(r.FormValue("page_id"), 10, 64) p.Image = fileID(pickFile(p.Image, r.FormValue("image"))) tags, tagsOK := parseTags(strings.Split(r.FormValue("tags"), ",")) |
