From 54e84be1458d59162e3efd03afe7c6dfdd07e246 Mon Sep 17 00:00:00 2001
From: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Date: Thu, 7 Nov 2024 15:59:16 +0100
Subject: [PATCH] hugo(refactor): use Page.Store instead of Page.Scratch
Page.Scratch was soft-deprecated in v0.138.0
https://github.com/gohugoio/hugo/releases/tag/v0.138.0
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
---
layouts/_default/cli.html | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/layouts/_default/cli.html b/layouts/_default/cli.html
index 58c99c2c2c..a18752576c 100644
--- a/layouts/_default/cli.html
+++ b/layouts/_default/cli.html
@@ -5,8 +5,8 @@
{{ else }}
{{ $data = index site.Data .Params.datafile }}
{{ end }}
- {{ .Scratch.Set "headings" slice }}
- {{ .Scratch.Set "subheadings" slice }}
+ {{ .Store.Set "headings" slice }}
+ {{ .Store.Set "subheadings" slice }}
{{ partial "breadcrumbs.html" . }}
@@ -84,11 +84,11 @@ can be removed entirely in a future release.
{{ $heading := dict "level" 2 "text" "Description" }}
{{ partialCached "heading.html" $heading "cli-description" }}
{{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }}
- {{ $.Scratch.Add "headings" $heading }}
+ {{ $.Store.Add "headings" $heading }}
{{ range $subHeadings }}
{{ $lvl := strings.Count "#" . }}
{{ $txt := strings.TrimLeft "# " . }}
- {{ $.Scratch.Add "headings" (dict "level" $lvl "text" $txt) }}
+ {{ $.Store.Add "headings" (dict "level" $lvl "text" $txt) }}
{{ end }}
{{ . | $.RenderString (dict "display" "block") }}
{{ end }}
@@ -97,7 +97,7 @@ can be removed entirely in a future release.
{{ with $opts }}
{{ $heading := dict "level" 2 "text" "Options" }}
{{ partialCached "heading.html" $heading "cli-options" }}
- {{ $.Scratch.Add "headings" $heading }}
+ {{ $.Store.Add "headings" $heading }}
@@ -162,18 +162,18 @@ can be removed entirely in a future release.
{{ $heading := dict "level" 2 "text" "Examples" }}
{{ partialCached "heading.html" $heading "cli-examples" }}
{{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }}
- {{ $.Scratch.Add "headings" $heading }}
+ {{ $.Store.Add "headings" $heading }}
{{ range $subHeadings }}
{{ $lvl := strings.Count "#" . }}
{{ $txt := strings.TrimLeft "# " . }}
- {{ $.Scratch.Add "headings" (dict "level" $lvl "text" $txt) }}
+ {{ $.Store.Add "headings" (dict "level" $lvl "text" $txt) }}
{{ end }}
{{ $.RenderString (dict "display" "block") . }}
{{ end }}
{{ if eq .Kind "section" }}
{{ $heading := dict "level" 2 "text" "Subcommands" }}
{{ partialCached "heading.html" $heading "cli-subcommands" }}
- {{ $.Scratch.Add "headings" $heading }}
+ {{ $.Store.Add "headings" $heading }}
@@ -202,7 +202,7 @@ can be removed entirely in a future release.
{{ T "tableOfContents" }}