mediocre-blog/srv/src/api/tpl/index.html

37 lines
764 B
HTML
Raw Normal View History

{{ define "body" }}
2022-05-15 03:30:18 +00:00
<ul id="posts-list">
{{ range .Posts }}
<li>
<h2>
<a href="posts/{{ .HTTPPath }}">{{ .Title }}</a>
</h2>
<span>{{ .PublishedAt.Format "2006-01-02" }}</span>
{{ if not .LastUpdatedAt.IsZero }}
<span>(Updated {{ .LastUpdatedAt.Format "2006-01-02" }})</span>
{{ end }}
<p>{{ .Description }}</p>
</li>
{{ end }}
2022-05-15 03:30:18 +00:00
</ul>
2022-05-15 03:30:18 +00:00
{{ if or (ge .PrevPage 0) (ge .NextPage 0) }}
<div id="page-turner">
{{ if ge .PrevPage 0 }}
<a style="float: left;" href="?p={{ .PrevPage}}">Newer</a>
{{ end }}
{{ if ge .NextPage 0 }}
<a style="float:right;" href="?p={{ .NextPage}}">Older</a>
{{ end }}
</div>
{{ end }}
2022-05-15 02:42:43 +00:00
{{ end }}
{{ template "base.html" . }}