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

34 lines
644 B
HTML
Raw Normal View History

{{ define "body" }}
2022-05-15 03:30:18 +00:00
{{ if ge .Payload.PrevPage 0 }}
2022-05-20 23:43:47 +00:00
<p>
<a href="?p={{ .Payload.PrevPage}}">&lt; &lt; Previous Page</a>
2022-05-20 23:43:47 +00:00
</p>
2022-08-17 03:55:32 +00:00
{{ else }}
<p>
Welcome to the Mediocre Blog! Posts are listed in chronological order.
</p>
{{ end }}
2022-05-20 23:43:47 +00:00
<ul>
2022-05-15 03:30:18 +00:00
{{ range .Payload.Posts }}
2022-05-15 03:30:18 +00:00
<li>
{{ DateTimeFormat .PublishedAt }}
&nbsp;&nbsp; <a href="{{ PostURL .ID }}">{{ .Title }}</a>
&nbsp;&nbsp; {{ .Description }}
2022-05-15 03:30:18 +00:00
</li>
{{ end }}
2022-05-15 03:30:18 +00:00
</ul>
{{ if ge .Payload.NextPage 0 }}
<p>
<a href="?p={{ .Payload.NextPage}}">Next Page &gt; &gt;</a>
</p>
2022-05-15 03:30:18 +00:00
{{ end }}
2022-05-15 02:42:43 +00:00
{{ end }}
{{ template "base.html" . }}