feat: add dates and summaries to default section and term pages

This commit is contained in:
Iain Learmonth 2026-04-16 10:00:46 +01:00
parent 2fa452c8b4
commit 596b4e4810
2 changed files with 22 additions and 13 deletions

View file

@ -1,10 +1,13 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ .Content }} {{ .Content }}
{{ range .Pages }} {{ range .Pages }}
<section> {{ $dateMachineP := .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> {{ $dateHumanP := .PublishDate | time.Format ":date_long" }}
{{ .Summary }} <section>
</section> <h2 class="no-bottom-margin"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }} <h4 class="no-top-margin"><time datetime="{{ $dateMachineP }}">{{ $dateHumanP }}</time></h4>
{{ .Summary }}
</section>
{{ end }}
{{ end }} {{ end }}

View file

@ -1,7 +1,13 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ .Content }} {{ .Content }}
{{ range .Pages }} {{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2> {{ $dateMachineP := .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}
{{ end }} {{ $dateHumanP := .PublishDate | time.Format ":date_long" }}
<section>
<h2 class="no-bottom-margin"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
<h4 class="no-top-margin"><time datetime="{{ $dateMachineP }}">{{ $dateHumanP }}</time></h4>
{{ .Summary }}
</section>
{{ end }}
{{ end }} {{ end }}