From 219207ea77ea903a3dacfe15b20915d96749fb0b Mon Sep 17 00:00:00 2001
From: Patrick Kollitsch <83281+davidsneighbour@users.noreply.github.com>
Date: Sun, 17 May 2026 09:33:58 +0000
Subject: [PATCH] fix: allow disabling dates in post summaries
---
layouts/post/summary.html | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/layouts/post/summary.html b/layouts/post/summary.html
index 651642b..3882823 100644
--- a/layouts/post/summary.html
+++ b/layouts/post/summary.html
@@ -1,8 +1,21 @@
+ {{ $show_date := and
+ (not .Date.IsZero)
+ (or
+ (and
+ (not (eq false site.Params.ananke.pages.show_date))
+ (not (eq false .Params.ananke.show_date))
+ )
+ (and
+ (eq false site.Params.ananke.pages.show_date)
+ (eq true .Params.ananke.show_date)
+ )
+ )
+ }}
<div class="mb3 pa4 {{ $.Param "text_color" | compare.Default "mid-gray" }} overflow-hidden">
- {{ if .Date }}
- <div class="f6">
- {{ .Date | time.Format (compare.Default "January 2, 2006" .Site.Params.date_format) }}
- </div>
+ {{ if $show_date }}
+ <time class="f6 db" {{ fmt.Printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safe.HTMLAttr }}>
+ {{- .Date | time.Format (compare.Default "January 2, 2006" .Site.Params.date_format) -}}
+ </time>
{{ end }}
<h1 class="f3 near-black">
<a href="{{ .RelPermalink }}" class="link black dim">
--
Gitblit v1.10.0