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

37 lines
806 B
HTML
Raw Normal View History

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