From 2032e1cdc2ccb833d1fa77abf9f6fe5467de1f9b Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 18 May 2026 21:05:45 -0700 Subject: [PATCH] Update theme with .Scratch -> .Store deprecation Signed-off-by: Danila Fedorin --- layouts/_markup/render-heading.html | 2 +- layouts/_markup/render-link.html | 2 +- layouts/_partials/geturl.html | 4 ++-- layouts/_shortcodes/internal.html | 6 +++--- layouts/_shortcodes/internalref.html | 2 +- layouts/home.html | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html index 6843b94..ab03657 100644 --- a/layouts/_markup/render-heading.html +++ b/layouts/_markup/render-heading.html @@ -1,4 +1,4 @@ -{{- .Page.Scratch.SetInMap "definedSections" (printf "#%s" .Anchor) true -}} +{{- .Page.Store.SetInMap "definedSections" (printf "#%s" .Anchor) true -}} {{- .Text | safeHTML -}} diff --git a/layouts/_markup/render-link.html b/layouts/_markup/render-link.html index 112daf2..de44e65 100644 --- a/layouts/_markup/render-link.html +++ b/layouts/_markup/render-link.html @@ -7,7 +7,7 @@ {{- if $isSamePage -}} {{- $class = "same-page-link" -}} - {{- if index (.Page.Scratch.Get "definedSections") .Destination -}} + {{- if index (.Page.Store.Get "definedSections") .Destination -}} {{- $icon = "arrow-up" -}} {{- else -}} {{- /* Do not render "down" links because don't know how to distinguish unseen titles from paragraph links. */ -}} diff --git a/layouts/_partials/geturl.html b/layouts/_partials/geturl.html index 9b3f04c..386a417 100644 --- a/layouts/_partials/geturl.html +++ b/layouts/_partials/geturl.html @@ -1,6 +1,6 @@ {{- $siteSourceUrl := site.Params.siteSourceUrl -}} -{{- $submoduleLinks := site.Data.submodules -}} -{{- $hostData := site.Data.hosts -}} +{{- $submoduleLinks := hugo.Data.submodules -}} +{{- $hostData := hugo.Data.hosts -}} {{- $scratch := .scratch -}} {{- $lines := .lines -}} {{- $scratch.Set "bestLength" -1 -}} diff --git a/layouts/_shortcodes/internal.html b/layouts/_shortcodes/internal.html index 356e5ec..5ad12d5 100644 --- a/layouts/_shortcodes/internal.html +++ b/layouts/_shortcodes/internal.html @@ -1,10 +1,10 @@ {{- $name := .Get 0 -}} {{- $number := 1 -}} -{{- with .Page.Scratch.Get "internal-ref-counter" -}} +{{- with .Page.Store.Get "internal-ref-counter" -}} {{- $number = add . 1 }} {{- end -}} -{{- .Page.Scratch.Set "internal-ref-counter" $number -}} -{{- .Page.Scratch.SetInMap "internal-ref" $name $number -}} +{{- .Page.Store.Set "internal-ref-counter" $number -}} +{{- .Page.Store.SetInMap "internal-ref" $name $number -}} {{ .Inner }} diff --git a/layouts/_shortcodes/internalref.html b/layouts/_shortcodes/internalref.html index 9fa2a02..387af11 100644 --- a/layouts/_shortcodes/internalref.html +++ b/layouts/_shortcodes/internalref.html @@ -1,5 +1,5 @@ {{- $name := .Get 0 -}} -{{- $number := index (.Page.Scratch.Get "internal-ref") $name -}} +{{- $number := index (.Page.Store.Get "internal-ref") $name -}} {{ .Inner }} diff --git a/layouts/home.html b/layouts/home.html index 66b3443..a34db76 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -2,9 +2,9 @@ {{ .Content }} {{ i18n "recentPosts" }}: -{{ partial "uniquebyseries.html" (dict "scratch" .Scratch) }} +{{ partial "uniquebyseries.html" (dict "scratch" .Store) }}
    - {{ range first 10 (.Scratch.Get "pages") }} + {{ range first 10 (.Store.Get "pages") }} {{ partial "post.html" (dict "page" . "linkSeries" true) }} {{ end }}