summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl/index.html
blob: 1858ea8f0e6da298045e7f145c6e528bedeb2868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{ define "body" }}

  <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 }}

  </ul>

  {{ 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 }}

{{ end }}

{{ template "base.html" . }}