Skip to content

Commit 334158a

Browse files
authored
chore: replace .Scratch with .Store (#818)
1 parent 184ee25 commit 334158a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

layouts/_partials/components/pager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{/* Article navigation on the footer of the article */}}
22

3-
{{- $reversePagination := .Scratch.Get "reversePagination" | default false -}}
3+
{{- $reversePagination := .Store.Get "reversePagination" | default false -}}
44

55
{{- $prev := cond $reversePagination .PrevInSection .NextInSection -}}
66
{{- $next := cond $reversePagination .NextInSection .PrevInSection -}}

layouts/_partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
1+
{{- $enableFooterSwitches := .Store.Get "enableFooterSwitches" | default false -}}
22
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
33
{{- $footerSwitchesVisible := and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}}
44
{{- $copyrightSectionVisible := or (.Site.Params.footer.displayPoweredBy | default true) .Site.Params.footer.displayCopyright -}}

layouts/_partials/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<!-- Sidebar on large screen -->
3131
{{- if $disableSidebar -}}
3232
{{- if $displayPlaceholder }}<div class="hx:max-xl:hidden hx:h-0 hx:w-64 hx:shrink-0"></div>{{ end -}}
33-
{{ .context.Scratch.Set "enableFooterSwitches" true }}
33+
{{ .context.Store.Set "enableFooterSwitches" true }}
3434
{{- else -}}
3535
<ul class="hx:flex hx:flex-col hx:gap-1 hx:max-md:hidden">
3636
{{ template "sidebar-main" (dict "context" $navRoot "page" $context "pageURL" $pageURL) }}

layouts/blog/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</div>
4141
{{- partial "components/last-updated.html" . -}}
4242
{{- if (site.Params.blog.article.displayPagination | default true) -}}
43-
{{- .Scratch.Set "reversePagination" (.Params.reversePagination | default true) -}}
43+
{{- .Store.Set "reversePagination" (.Params.reversePagination | default true) -}}
4444
{{- partial "components/pager.html" . -}}
4545
{{ end }}
4646
{{- partial "components/comments.html" . -}}

layouts/list.rss.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
{{ end }}
1515
{{ if not $.Section }}
1616
{{ $sections := .Site.Params.rss.sections | default (slice "blog") }}
17-
{{ .Scratch.Set "rssPages" (first 50 (where $.Site.RegularPages "Type" "in" $sections )) }}
17+
{{ .Store.Set "rssPages" (first 50 (where $.Site.RegularPages "Type" "in" $sections )) }}
1818
{{ else }}
1919
{{ if $.Parent.IsHome }}
20-
{{ .Scratch.Set "rssPages" (first 50 (where $.Site.RegularPages "Type" $.Section )) }}
20+
{{ .Store.Set "rssPages" (first 50 (where $.Site.RegularPages "Type" $.Section )) }}
2121
{{ else }}
22-
{{ .Scratch.Set "rssPages" (first 50 $.Pages) }}
22+
{{ .Store.Set "rssPages" (first 50 $.Pages) }}
2323
{{ end }}
2424
{{ end }}
25-
{{ range (.Scratch.Get "rssPages") }}
25+
{{ range (.Store.Get "rssPages") }}
2626
<item>
2727
<title>{{ .Title }}</title>
2828
<link>{{ .Permalink }}</link>

0 commit comments

Comments
 (0)