GoBlog/templates/post.gohtml

33 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-07-31 13:48:01 +00:00
{{ define "title" }}
2020-10-12 16:47:23 +00:00
<title>{{ with p .Data "title" }}{{ . }} - {{end}}{{ .Blog.Title }}</title>
2020-07-31 13:48:01 +00:00
{{ end }}
{{ define "main" }}
<main class=h-entry>
<article>
2020-10-12 16:47:23 +00:00
{{ with title .Data }}<h1 class=p-name>{{ . }}</h1>{{ end }}
2020-10-12 17:12:43 +00:00
{{ if .Data.Published }}
<p>{{ string .Blog.Lang "publishedon" }} {{ dateformat .Data.Published "02. Jan 2006" }}</p>{{ end }}
{{ if .Data.Updated }}
<p>{{ string .Blog.Lang "updatedon" }} {{ dateformat .Data.Updated "02. Jan 2006" }}</p>{{ end }}
2020-10-12 16:47:23 +00:00
{{ with .Data.Content }}
<div class=e-content>{{ md . }}</div>
{{ end }}
2020-07-31 13:48:01 +00:00
</article>
2020-10-12 16:47:23 +00:00
{{ $post := .Data }}
{{ range $i, $tax := .Blog.Taxonomies }}
2020-09-01 17:08:57 +00:00
{{ $tvs := ps $post $tax.Name }}
{{ if gt (len $tvs) 0 }}
<p>In <b>{{ $tax.Title }}</b>:
{{ range $j, $tv := $tvs }}
<a href="/{{ $tax.Name }}/{{ urlize $tv }}">{{ $tv }}</a>
{{ end }}
</p>
{{ end }}
{{ end }}
2020-07-31 13:48:01 +00:00
</main>
{{ end }}
2020-08-05 17:14:10 +00:00
{{ define "post" }}
{{ template "base" . }}
2020-07-31 13:48:01 +00:00
{{ end }}