From 13dde12ae0b15294f9f45ea25e9e6cb0260546f5 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 27 Mar 2026 03:33:15 +0000 Subject: [PATCH] refactor(hugo): use strings.ReplacePairs for chained replacements Adopt Hugo v0.158's strings.ReplacePairs in rss.xml and parse_block_v3.html to replace nested replace calls. --- modules/blox/layouts/_partials/functions/parse_block_v3.html | 2 +- modules/blox/layouts/rss.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/blox/layouts/_partials/functions/parse_block_v3.html b/modules/blox/layouts/_partials/functions/parse_block_v3.html index ff33c000..70b74728 100644 --- a/modules/blox/layouts/_partials/functions/parse_block_v3.html +++ b/modules/blox/layouts/_partials/functions/parse_block_v3.html @@ -265,7 +265,7 @@ {{ $hash_id := $block.id | default (printf "section-%s" (replace $block_type "." "-")) }} {{ $css_classes := $block.design.css_class | default "" }} -{{ $widget_class := printf "blox-%s" (replace (replace $block_type "." "-") "_" "-") }} +{{ $widget_class := printf "blox-%s" (strings.ReplacePairs $block_type "." "-" "_" "-") }} {{/* Extract background-specific CSS classes */}} {{ $bg_css_classes := $bg.css_class | default "" }} diff --git a/modules/blox/layouts/rss.xml b/modules/blox/layouts/rss.xml index c3baf6ea..bb636625 100644 --- a/modules/blox/layouts/rss.xml +++ b/modules/blox/layouts/rss.xml @@ -17,7 +17,7 @@ {{ .Title | default site.Title }} HugoBlox Kit (https://hugoblox.com) {{- with site.Language.Locale }}{{.}}{{end -}} - {{- with site.Copyright }}{{ replace (replace . "{year}" now.Year) "©" "©" | plainify }}{{end -}} + {{- with site.Copyright }}{{ strings.ReplacePairs . "{year}" now.Year "©" "©" | plainify }}{{end -}} {{- if not .Date.IsZero }}{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end -}} {{- if .Scratch.Get "og_image" }}