1
mirror of https://github.com/jlelse/GoBlog synced 2024-06-02 07:24:27 +00:00
GoBlog/templates/post.gohtml
Jan-Lukas Else 70f220e693 API endpoint to read posts
API endpoint to create posts from Hugo markdown file
Method to create redirects
Dependency updates
...
2020-09-18 12:34:52 +02:00

32 lines
1022 B
Plaintext

{{ define "title" }}
<title>{{ with p . "title" }}{{ . }} - {{end}}{{ blog.Title }}</title>
{{ end }}
{{ define "main" }}
<main class=h-entry>
<article>
{{ with title . }}<h1 class=p-name>{{ . }}</h1>{{ end }}
{{ with .Published }}<p>Published on {{ dateformat . "02. Jan 2006" }}</p>{{ end }}
{{ with .Updated }}<p>Updated on {{ dateformat . "02. Jan 2006" }}</p>{{ end }}
{{ with .Content }}
<div class=e-content>{{ md . }}</div>
{{ end }}
</article>
{{ $taxonomies := blog.Taxonomies }}
{{ $post := . }}
{{ range $i, $tax := $taxonomies }}
{{ $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 }}
</main>
{{ end }}
{{ define "post" }}
{{ template "base" . }}
{{ end }}