Add [future]/[expired] to future/expired posts

Implements adityatelange/hugo-PaperMod#1119
This commit is contained in:
Gina Häußge 2023-01-22 12:39:22 +01:00
parent d3d90be8a4
commit 2a4275686c
3 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,9 @@
}
.entry-cover,
.entry-isdraft {
.entry-isdraft,
.entry-isfuture,
.entry-isexpired {
font-size: 14px;
color: var(--secondary);
}

View File

@ -68,6 +68,8 @@
<h2>
{{- .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }}
{{- if and (not .Date.IsZero) (gt (time .Date) now) }}<sup><span class="entry-isfuture">&nbsp;&nbsp;[future]</span></sup>{{- end }}
{{- if and (not .ExpiryDate.IsZero) (gt now (time .ExpiryDate)) }}<sup><span class="entry-isexpired">&nbsp;&nbsp;[expired]</span></sup>{{- end }}
</h2>
</header>
{{- if (ne (.Param "hideSummary") true) }}

View File

@ -6,6 +6,8 @@
<h1 class="post-title">
{{ .Title }}
{{- if .Draft }}<sup><span class="entry-isdraft">&nbsp;&nbsp;[draft]</span></sup>{{- end }}
{{- if and (not .Date.IsZero) (gt (time .Date) now) }}<sup><span class="entry-isfuture">&nbsp;&nbsp;[future]</span></sup>{{- end }}
{{- if and (not .ExpiryDate.IsZero) (gt now (time .ExpiryDate)) }}<sup><span class="entry-isexpired">&nbsp;&nbsp;[expired]</span></sup>{{- end }}
</h1>
{{- if .Description }}
<div class="post-description">