aboutsummaryrefslogtreecommitdiff
path: root/layouts/blog/list.html
blob: 044f58737bed1221348ee02a03e98618a7f6542d (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
{{ define "main" }}
  <div class="list">
    <h1>{{ if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }}{{ end }}</h1>
    {{ .Content }}

    {{ if .Sections }}
      {{ range .Sections.ByDate.Reverse }}
        <a href="{{ .RelPermalink }}">
          <h2 class="section" id="{{ .Title }}">{{ .Title }}:</h2>
        </a>
        {{ range (union .Sections .Pages).ByDate.Reverse }}
          <p>
            <a href="{{ .RelPermalink }}">{{ .Title }}</a>
            <sup>
              {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "January" }}
            </sup>
          </p>
        {{ end }}
      {{ end }}
    {{ else }}
      {{ range (union .Sections .Pages).ByDate.Reverse }}
        <p>
          <a href="{{ .RelPermalink }}">{{ .Title }}</a>
          <sup>
            {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "January" }}
          </sup>
        </p>
      {{ end }}
    {{ end }}
  </div>
{{ end }}