A fast and simple blog backend.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mediocre-blog/srv/src/api/tpl/index.html

28 lines
560 B

{{ define "body" }}
<ul id="posts-list">
{{ range .Posts }}
<li>
<h2>
<a href="{{ .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 }}
</ul>
{{ end }}
{{ if ge .PrevPage 0 }}
<a href="?p={{ .PrevPage}}">Previous</a>
{{ end }}
{{ if ge .NextPage 0 }}
<a href="?p={{ .NextPage}}">Next</a>
{{ end }}
{{ template "base.html" . }}