Update theme with .Scratch -> .Store deprecation

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2026-05-18 21:05:45 -07:00
parent 20217e0b97
commit 2032e1cdc2
6 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
{{- .Page.Scratch.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
{{- .Page.Store.SetInMap "definedSections" (printf "#%s" .Anchor) true -}}
<a href="#{{ .Anchor }}">
<h{{ .Level }} id="{{ .Anchor }}">
{{- .Text | safeHTML -}}

View File

@@ -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. */ -}}

View File

@@ -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 -}}

View File

@@ -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 -}}
<span class="internal-ref" id="internal-ref-{{ $name }}">
{{ .Inner }}

View File

@@ -1,5 +1,5 @@
{{- $name := .Get 0 -}}
{{- $number := index (.Page.Scratch.Get "internal-ref") $name -}}
{{- $number := index (.Page.Store.Get "internal-ref") $name -}}
<a href="#internal-ref-{{ $name }}">
{{ .Inner }}

View File

@@ -2,9 +2,9 @@
{{ .Content }}
{{ i18n "recentPosts" }}:
{{ partial "uniquebyseries.html" (dict "scratch" .Scratch) }}
{{ partial "uniquebyseries.html" (dict "scratch" .Store) }}
<ul class="post-list">
{{ range first 10 (.Scratch.Get "pages") }}
{{ range first 10 (.Store.Get "pages") }}
{{ partial "post.html" (dict "page" . "linkSeries" true) }}
{{ end }}
</ul>