From 7956e936c97c9de6bdfa2401b47a2d39086a210f Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:10:14 +0100 Subject: [PATCH 1/2] fix: correct tags grouping by year --- layouts/tags/list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/tags/list.html b/layouts/tags/list.html index e38a7816f..e652c4241 100644 --- a/layouts/tags/list.html +++ b/layouts/tags/list.html @@ -40,7 +40,7 @@ {{ else }} {{ $dateFormat := default "Jan 2" (index .Site.Params "date_format") }} {{ $.Scratch.Set "lastYear" ""}} - {{ range .Pages }} + {{ range .Pages.ByDate.Reverse }} {{ $year := .Date.Year }} {{ $lastYear := $.Scratch.Get "lastYear"}} {{- $title := .Title }} From 87cc9cca6b853efc4decdb7eeff830dbdf7adf8c Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:42:56 +0100 Subject: [PATCH 2/2] perf: use partialCached for 100% cache-potential partials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cache assets/version.html with a constant key so go.mod is read once per language instead of once per page (103 → 3 calls) - Cache utilities/bundlev2.html in stylesheet.html keyed on source, language, and module list to reuse compiled SCSS bundles across pages - Cache head/icons.html keyed on CSS content hash so SVG icons are published once per theme rather than once per page - Cache utilities/bundlev2.html in the inline bundle-script partial keyed on destination and module list to reuse JS bundles across pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 --- layouts/_partials/footer/scripts.html | 4 ++-- layouts/_partials/head/head.html | 2 +- layouts/_partials/head/stylesheet.html | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_partials/footer/scripts.html b/layouts/_partials/footer/scripts.html index eec17c324..a05fa18a0 100644 --- a/layouts/_partials/footer/scripts.html +++ b/layouts/_partials/footer/scripts.html @@ -40,7 +40,7 @@ {{- $destination = path.Join (path.Dir $destination) (printf "%s.%s%s" (path.BaseName $destination) $page.Language.Lang (path.Ext $destination)) -}} {{- end -}} - {{- $bundle := partial "utilities/bundlev2.html" (dict + {{- $bundle := partialCached "utilities/bundlev2.html" (dict "page" $page "match" $match "filename" $destination @@ -50,7 +50,7 @@ "skip-template" $skipTemplate "enable-template" $enableTemplate "debugging" site.Params.debugging.showJS - ) -}} + ) $destination (delimit $modules ",") -}} {{- $js := $bundle.bundle -}} {{- $jsmod := $bundle.module -}} diff --git a/layouts/_partials/head/head.html b/layouts/_partials/head/head.html index 7633b59e6..b6a7a41f2 100644 --- a/layouts/_partials/head/head.html +++ b/layouts/_partials/head/head.html @@ -1,5 +1,5 @@ {{ define "head" }} - {{- $version := strings.TrimSpace (partial "assets/version.html" .) -}} + {{- $version := strings.TrimSpace (partialCached "assets/version.html" . "version") -}} {{ $desc := .Page.Description | default (.Page.Content | safeHTML | truncate 150) -}} diff --git a/layouts/_partials/head/stylesheet.html b/layouts/_partials/head/stylesheet.html index bbe1ffdd9..9e9364ec6 100644 --- a/layouts/_partials/head/stylesheet.html +++ b/layouts/_partials/head/stylesheet.html @@ -77,20 +77,20 @@ "enableSourceMap" (not hugo.IsProduction) "vars" $vars ) -}} -{{- $bundle := partial "utilities/bundlev2.html" (dict +{{- $bundle := partialCached "utilities/bundlev2.html" (dict "page" page "match" $source "filename" (printf "scss/bundle-%s.scss" (hash.XxHash $source)) "modules" $modules "basepath" "scss" "debugging" site.Params.debugging.showSCSS -) -}} +) $source page.Language.Lang (delimit $modules ",") -}} {{- if and (gt ($bundle.bundle.Content | len) 0) (not $error) }} {{- $css := $bundle.bundle | resources.ExecuteAsTemplate $target . | toCSS $options -}} {{ if $core }} - {{- partial "head/icons.html" (dict "css" $css) -}} + {{- partialCached "head/icons.html" (dict "css" $css) ($css.Content | md5) -}} {{ end }} {{- if site.Params.style.purge -}} {{- $post_options := dict "config" "config" "noMap" hugo.IsProduction -}}