From 2a4275686cab10fe06fccfa87065a08673d3c9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 22 Jan 2023 12:39:22 +0100 Subject: [PATCH] Add [future]/[expired] to future/expired posts Implements adityatelange/hugo-PaperMod#1119 --- assets/css/common/post-entry.css | 4 +++- layouts/_default/list.html | 2 ++ layouts/_default/single.html | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/css/common/post-entry.css b/assets/css/common/post-entry.css index 885aa2a486..4ca5864867 100644 --- a/assets/css/common/post-entry.css +++ b/assets/css/common/post-entry.css @@ -81,7 +81,9 @@ } .entry-cover, -.entry-isdraft { +.entry-isdraft, +.entry-isfuture, +.entry-isexpired { font-size: 14px; color: var(--secondary); } diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3a6f316eed..3c17b6f04b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -68,6 +68,8 @@

{{- .Title }} {{- if .Draft }}  [draft]{{- end }} + {{- if and (not .Date.IsZero) (gt (time .Date) now) }}  [future]{{- end }} + {{- if and (not .ExpiryDate.IsZero) (gt now (time .ExpiryDate)) }}  [expired]{{- end }}

{{- if (ne (.Param "hideSummary") true) }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b7497255b6..8103f603af 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,6 +6,8 @@

{{ .Title }} {{- if .Draft }}  [draft]{{- end }} + {{- if and (not .Date.IsZero) (gt (time .Date) now) }}  [future]{{- end }} + {{- if and (not .ExpiryDate.IsZero) (gt now (time .ExpiryDate)) }}  [expired]{{- end }}

{{- if .Description }}