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/templates/blog/search.html | |
| 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/templates/blog/search.html')
| -rw-r--r-- | internal/web/templates/blog/search.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/web/templates/blog/search.html b/internal/web/templates/blog/search.html index 7ee05fc..9a00c9d 100644 --- a/internal/web/templates/blog/search.html +++ b/internal/web/templates/blog/search.html @@ -8,7 +8,7 @@ <p class="muted small">{{if eq .Data.total 1}}{{t "One post matches."}}{{else}}{{tf "%d posts match." .Data.total}}{{end}}</p> <ul class="search-results"> {{range .Data.hits}}<li> - <a href="/{{.PageSlug}}/{{.Slug}}">{{.Title}}</a>{{if $.Data.theme.ShowDates}} <span class="post-date">{{postdate $.Data.theme.DateFormat .CreatedAt}}</span>{{end}} + <a href="/{{.PageSlug}}/{{.Slug}}">{{.Title}}</a>{{if and $.Data.theme.ShowDates (not .HideDate)}} <span class="post-date">{{postdate $.Data.theme.DateFormat .CreatedAt}}</span>{{end}} <p class="snippet">{{.Snippet}}</p> </li> {{end}}</ul> |
