mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-05 14:14:41 +00:00
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.
This commit is contained in:
1 parent
815d25ca9d
commit
13dde12ae0
2 files changed
+2
-2
No files matched your search
@@ -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 "" }}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<description>{{ .Title | default site.Title }}</description>
|
||||
<generator>HugoBlox Kit (https://hugoblox.com)</generator>
|
||||
{{- with site.Language.Locale }}<language>{{.}}</language>{{end -}}
|
||||
{{- with site.Copyright }}<copyright>{{ replace (replace . "{year}" now.Year) "©" "©" | plainify }}</copyright>{{end -}}
|
||||
{{- with site.Copyright }}<copyright>{{ strings.ReplacePairs . "{year}" now.Year "©" "©" | plainify }}</copyright>{{end -}}
|
||||
{{- if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end -}}
|
||||
{{- if .Scratch.Get "og_image" }}
|
||||
<image>
|
||||
|
||||
Reference in new issue
Block a user