diff options
Diffstat (limited to 'layouts/partials/index')
-rw-r--r-- | layouts/partials/index/incidents-monthly.html | 29 | ||||
-rw-r--r-- | layouts/partials/index/incidents-yearly.html | 9 |
2 files changed, 35 insertions, 3 deletions
diff --git a/layouts/partials/index/incidents-monthly.html b/layouts/partials/index/incidents-monthly.html new file mode 100644 index 0000000..263bc52 --- /dev/null +++ b/layouts/partials/index/incidents-monthly.html @@ -0,0 +1,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 }} diff --git a/layouts/partials/index/incidents-yearly.html b/layouts/partials/index/incidents-yearly.html index 5cc323a..d07be9d 100644 --- a/layouts/partials/index/incidents-yearly.html +++ b/layouts/partials/index/incidents-yearly.html @@ -1,9 +1,12 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} -{{ range ((where .Site.RegularPages "Params.section" "issue").GroupByDate "2006") }} - <p class="center" id="{{ .Key }}"><a href="#{{ .Key }}" class="no-underline"><strong>{{ .Key }}</strong> + +{{ range ($incidents.GroupByDate "2006") }} + <div class="padding"></div> + <hr> + <p class="center" id="archive-{{ .Key }}"><a href="#archive-{{ .Key }}" class="no-underline"><strong>{{ .Key }}</strong> <span class="faded">({{ len .Pages }})</span> - </a></p> + </a></p><hr> {{ range .Pages }} {{ .Render "small" }} |