aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/templates/blog/post.html
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-17 21:42:02 +0300
committergrm <grm@eyesin.space>2026-09-17 21:42:02 +0300
commit2a347ced1b4ea8c24440f646df35207c3a3597ac (patch)
tree2bdfdbb32173172975e576b56bf0636af7462817 /internal/web/templates/blog/post.html
parentb233445a73168994087356d45b5dc7dd6a07aa8e (diff)
downloadblogspace-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/templates/blog/post.html')
-rw-r--r--internal/web/templates/blog/post.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/web/templates/blog/post.html b/internal/web/templates/blog/post.html
index d16e842..33a1723 100644
--- a/internal/web/templates/blog/post.html
+++ b/internal/web/templates/blog/post.html
@@ -2,7 +2,7 @@
{{define "content"}}
<article class="post single">
<h1 class="post-title">{{.Data.post.Title}}</h1>
- <p class="post-date">{{if .Data.theme.ShowDates}}{{postdate .Data.theme.DateFormat .Data.post.CreatedAt}} &middot; {{end}}<a href="{{if .Data.page.IsHome}}/{{else}}/{{.Data.page.Slug}}{{end}}">{{.Data.page.Title}}</a></p>
+ <p class="post-date">{{if and .Data.theme.ShowDates (not .Data.post.HideDate)}}{{postdate .Data.theme.DateFormat .Data.post.CreatedAt}} &middot; {{end}}<a href="{{if .Data.page.IsHome}}/{{else}}/{{.Data.page.Slug}}{{end}}">{{.Data.page.Title}}</a></p>
{{template "posttags" (dict "tags" .Data.post.Tags "hash" .Data.theme.TagHash)}}
{{$img := .Data.post.Image}}{{$place := .Data.theme.PostImage}}
{{if and $img (eq $place "top")}}<p class="post-image"><img src="/media/{{$img}}" alt=""></p>{{end}}