aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index/incidents-monthly.html
blob: 263bc52202c91fa501e3c107855f2038a6ff089e (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
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}



{{ range ($incidents.GroupByDate "1") }}
  <div class="padding"></div>
  <hr>
  <p class="center" id="archive-{{ range first 1 .Pages }}{{ .Date.Format "2006" }}{{ end }}-{{ .Key }}"><a href="#archive-{{ range first 1 .Pages }}{{ .Date.Format "2006" }}{{ end }}-{{ .Key }}" class="no-underline">
    <b>
      <!-- Hugo requires a '0' in the month
      which is why this check exists -->
      {{ if gt .Key 9 }}
        {{ $month := printf "2006-%s-02" .Key }}
        {{ $monthDate := $month | time }}
        {{ $monthDate.Format "January" }}
      {{ else }}
        {{ $month := printf "2006-0%s-02" .Key }}
        {{ $monthDate := $month | time }}
        {{ $monthDate.Format "January" }}
      {{ end }}
      {{ range first 1 .Pages }}{{ .Date.Format "2006" }}{{ end }}
    </b><small class="faded">({{ len .Pages }})</small>
  </a></p>
  <hr>

  {{ range .Pages }}
    {{ .Render "small" }}
  {{ end }}
{{ end }}