From 2bde80fd57f99d37bc8dbe617bfda08e7fd2167f Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Mon, 14 Aug 2023 21:50:13 -0400 Subject: [PATCH] Added blurb at top of observations page --- layouts/observations/list.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/layouts/observations/list.html b/layouts/observations/list.html index 63dbb82..57fd69e 100644 --- a/layouts/observations/list.html +++ b/layouts/observations/list.html @@ -2,6 +2,22 @@ {{ partial "header.html" . }}
+ {{ $posts := where site.RegularPages "Type" "observations" }} + {{ $postCount := len $posts }} + {{ range last 1 $posts }} + {{ $scratch := newScratch }} + {{ $scratch.Set "researchGradeCount" 0 }} + {{ range .Pages }} + {{ if (eq .quality_grade "research")}} + {{ $scratch.Add "researchGradeCount" 1 }} + {{ end }} + {{ end }} + {{ $tags := .Site.Taxonomies.tags }} +
+ Hello! This page contains {{ $postCount | lang.NumFmt 0 }} observations, + {{ len $tags }} of which are research grade. +
+ {{ end }} {{ .Content }} {{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} {{ range $index, $value := .Pages.GroupByDate $listPageDateFormat }}