added more fields to be rendered for post

This commit is contained in:
2026-02-01 17:46:53 -05:00
parent 4f0b7c773a
commit a59c2dac26

View File

@@ -1,10 +1,39 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> <article id="post">
<h1>{{ .Title }}</h1>
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} <section id="frontmatter">
{{ $dateHuman := .Date | time.Format ":date_long" }} {{ if ne .PublishDate nil }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> {{ $dateMachine := .PublishDate | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .PublishDate | time.Format "2 Jan 2006" }}
{{ .Content }} <time datetime="{{ $dateMachine }}">Published {{ $dateHuman }}</time>
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ else }}
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format "2 Jan 2006" }}
<time datetime="{{ $dateMachine }}">Created {{ $dateHuman }}</time>
{{ end }}
{{ with .Params.author }}
<p>Written by {{ . }}</p>
{{ end }}
{{ with .Params.editor }}
{{ if ne .Params.editor .Params.author }}
<p>Edited by {{ .Params.editor }}</p>
{{ end }}
{{ end }}
{{ with .Params.translator }}
<p>Translated by {{ . }}</p>
{{ end }}
</section>
<section id="content">
{{ .Content }}
</section>
<!-- {{ range .Params.updates }}
<details>
<summary>{{ .mod }}</summary>
{{ with .comment }}
<p>{{ . }}</p>
{{ end }}
</details>
{{ end }} -->
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
</article>
{{ end }} {{ end }}