From 837003af2d96dda1ee1261c242c2a3678ff73286 Mon Sep 17 00:00:00 2001 From: John Peart <4903081+johnpeart@users.noreply.github.com> Date: Sun, 19 May 2024 12:04:35 +0100 Subject: [PATCH] Add stats page --- pages/stats.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pages/stats.md diff --git a/pages/stats.md b/pages/stats.md new file mode 100644 index 0000000..5a0430f --- /dev/null +++ b/pages/stats.md @@ -0,0 +1,30 @@ +--- +layout: page +title: Stats +permalink: /stats/ +--- + +{% assign years = "2020, 2021, 2022, 2023, 2024" | split: ", " | reverse %} + +{% for year in years %} +{% assign year = year | date: "%Y" %} +

{{ year }}

+
+{% assign collections = "blogpost, weeknotes, now, note, list, photo, reply, share, music, manuals" | split: ", " %} +{% for collection in collections %} + {% assign count = 0 %} + {% for item in site[collection] %} + {% assign postYear = item.date | date: "%Y" %} + {% if postYear == year %} + {% assign count = count | plus: 1 %} + {% endif %} + {% endfor %} + {% if count > 0 %} +
+
{{ collection }}
+
{{ count }}
+
+ {% endif %} +{% endfor %} +
+{% endfor %} \ No newline at end of file