summaryrefslogtreecommitdiff
path: root/src/http/tpl/posts.html
blob: 0df166a79a69ce48ca95a46bad60c520d57d3810 (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
37
38
39
40
{{ define "body" }}

  {{ $page := .GetQueryIntValue "page" 0 -}}
  {{ $getPostsRes := .GetPosts $page 20 -}}

  {{ if gt $page 0 }}
  <p>
    <a href="{{ .RootURL.Posts.Page (.Add $page -1) }}">&lt; &lt; Previous Page</a>
  </p>
  {{ else }}
  <p>
    Here you'll find an archive of all published posts. The content varies
    almost as much as the quality!
  </p>
  {{ end }}

  <ul>
  {{ range $getPostsRes.Posts }}
    <li>
      <strong><a href="{{ $.RootURL.Post .ID }}">
        {{ .PublishedAt.Format "2006-01-02" }} - {{ .Title }}
      </a></strong>
      {{ if .Description }}
        <br/><em>{{ .Description }}</em>
      {{ end }}
    </li>
  {{ end }}
  </ul>

  {{ if $getPostsRes.HasMore }}
  <p>
    <a href="{{ .RootURL.Posts.Page (.Add $page 1) }}">Next Page &gt; &gt;</a>
  </p>
  {{ end }}

  {{ template "gemini-cta.html" . }}

{{ end }}

{{ template "base.html" . }}