From 47ad2d183c2487539c07918763ccce3daee2b665 Mon Sep 17 00:00:00 2001 From: crnh <30109443+crnh@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:20:51 +0200 Subject: Add options to hide list dates (#115) Add showListDate parameter, show readTime dot if date is present --- layouts/_default/single.html | 2 +- layouts/partials/post-entry.html | 9 ++++----- wiki/features/collections.md | 9 +++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 4398ce5..0538658 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -34,7 +34,7 @@ {{- end }} {{- if .Param "readTime" }} - · + {{ if .Date }} · {{ end }} {{- .ReadingTime }} min read {{- end }}
diff --git a/layouts/partials/post-entry.html b/layouts/partials/post-entry.html index 1f57f23..ac1386b 100644 --- a/layouts/partials/post-entry.html +++ b/layouts/partials/post-entry.html @@ -1,11 +1,10 @@{{ .Date | time.Format $dateFormat }}
+ {{ if .Parent.Param "showListDate" | default true }} +{{ .Date | time.Format $dateFormat }}
+ {{ end }}diff --git a/wiki/features/collections.md b/wiki/features/collections.md index afc6394..8a1fa79 100644 --- a/wiki/features/collections.md +++ b/wiki/features/collections.md @@ -38,3 +38,12 @@ Summaries can be turned on and off with this setting. [params] listSummaries = true ``` + +## Hide List Date + +To hide the dates on the list page, add the following to the frontmatter of the collection's `_index.md`: + +```toml +[params] +showListDate = false +``` \ No newline at end of file -- cgit v1.2.3