Add dates and tags to blog posts and fix date formating so it's localized

This commit is contained in:
bbb 2025-02-23 11:31:02 +01:00
parent 10d9e6870e
commit cd9afef68d
No known key found for this signature in database
GPG key ID: 486F0D69C845416E
2 changed files with 12 additions and 4 deletions

View file

@ -8,10 +8,7 @@
{{ range $pages.ByPublishDate.Reverse }} {{ range $pages.ByPublishDate.Reverse }}
<p> <p>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ $customDateFormat := "January 2, 2006" }} <small class="text-secondary">{{ .PublishDate | time.Format ":date_medium" }}</small>
{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
<br>
<small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
{{ partial "tags" . }} {{ partial "tags" . }}
{{ if eq .Site.Params.showPostSummary true }} {{ if eq .Site.Params.showPostSummary true }}
<br> <br>

View file

@ -0,0 +1,11 @@
{{- define "main" -}}
<h1>{{ .Title | markdownify }}</h1>
<small class="text-secondary">{{ .PublishDate | time.Format ":date_medium" }}</small>
{{ partial "tags" . }}
{{ .Content }}
{{- end -}}