From 1f1e07b4bfe1bdb7b1665f4c9c0160c4cfefe6fe Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Tue, 22 Nov 2022 19:06:34 -0500 Subject: [PATCH] Updating theme to include tag counts and description on blog page --- layouts/_default/stats.html | 5 +++++ layouts/blog/list.html | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html index d275e95..8cb0297 100644 --- a/layouts/_default/stats.html +++ b/layouts/_default/stats.html @@ -5,6 +5,7 @@
{{ .Content }} + {{ $tags := .Site.Taxonomies.tags }} {{ $posts := where site.RegularPages "Type" "blog" }} {{ $postCount := len $posts }} @@ -42,6 +43,10 @@ Average Words per Post {{ $avgPostLength | lang.NumFmt 0 }} + + Number of Topics + {{ len $tags | lang.NumFmt 0 }} + Longest Post Published diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 8133c8e..81e4ff5 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -3,6 +3,21 @@
{{ partial "search.html" . }} {{ partial "tags/all.html" . }} + +
+ {{ $posts := where site.RegularPages "Type" "blog" }} + {{ $postCount := len $posts }} + {{ range last 1 $posts }} + {{ $tags := .Site.Taxonomies.tags }} +
+ Hello! This page contains {{ $postCount | lang.NumFmt 0 }} posts + written in the past {{ div (sub now.Unix .Date.Unix) 31536000 }} years + spanning {{ len $tags }} topics within the dropdown above. +
+ {{ end }} + + +
{{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}}