From 551938f0b418f63abd4eef514f81b9bf39c1ee95 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Wed, 21 Feb 2024 14:32:05 +0800 Subject: [PATCH] Revert ":bug: Fix: to create a scratch pad that is not reset on server rebuilds, use the Store method instead of Scratch method (fixes #417)" This reverts commit 9d6ee9feefd48ff00cdf0c69c0e64082e20ce556. --- layouts/_default/single.md | 2 +- layouts/partials/init/patch.html | 2 +- layouts/partials/single/post-author.html | 4 ++-- layouts/partials/single/reward.html | 2 +- layouts/shortcodes/reward.html | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_default/single.md b/layouts/_default/single.md index 7fe4cff81..896459710 100644 --- a/layouts/_default/single.md +++ b/layouts/_default/single.md @@ -1,5 +1,5 @@ {{- $params := .Scratch.Get "params" -}} -{{- $author := .Store.Get "author" -}} +{{- $author := .Scratch.Get "author" -}} # {{ .Title }} {{ if $params.password -}} diff --git a/layouts/partials/init/patch.html b/layouts/partials/init/patch.html index b472e21f6..5fb01c5a0 100644 --- a/layouts/partials/init/patch.html +++ b/layouts/partials/init/patch.html @@ -29,7 +29,7 @@ -}} {{- end -}} {{- end -}} -{{- .Store.Set "author" $author -}} +{{- .Scratch.Set "author" $author -}} {{- /* Toc data patch */ -}} {{- $toc := $params.toc -}} diff --git a/layouts/partials/single/post-author.html b/layouts/partials/single/post-author.html index 5a889df46..81ac927d3 100644 --- a/layouts/partials/single/post-author.html +++ b/layouts/partials/single/post-author.html @@ -1,5 +1,5 @@ -{{- $params := .Params | merge .Site.Params.page -}} -{{- $author := .Store.Get "author" -}} +{{- $params := .Scratch.Get "params" -}} +{{- $author := .Scratch.Get "author" -}} {{- $content := $author.name -}} diff --git a/layouts/partials/single/reward.html b/layouts/partials/single/reward.html index d7f347117..e5c79c9ea 100644 --- a/layouts/partials/single/reward.html +++ b/layouts/partials/single/reward.html @@ -1,4 +1,4 @@ {{- $reward := .Scratch.Get "reward" -}} -{{- $author := .Store.Get "author" -}} +{{- $author := .Scratch.Get "author" -}} {{- $options := dict "Reward" $reward "Id" "fi-reward" "Author" $author.name -}} {{- partial "plugin/reward.html" $options -}} diff --git a/layouts/shortcodes/reward.html b/layouts/shortcodes/reward.html index fe59758cf..182a4d759 100644 --- a/layouts/shortcodes/reward.html +++ b/layouts/shortcodes/reward.html @@ -3,7 +3,7 @@ {{- $alipay := (.Get "alipay") | default (.Get 1) -}} {{- $paypal := (.Get "paypal") | default (.Get 2) -}} {{- $bitcoin := (.Get "bitcoin") | default (.Get 3) -}} -{{- $author := (.Get "author") | default (.Get 4) | default (.Page.Store.Get "author").name -}} +{{- $author := (.Get "author") | default (.Get 4) | default (.Page.Scratch.Get "author").name -}} {{- $comment := (.Get "comment") | default (.Get 5) -}} {{- $mode := (.Get "mode") | default (.Get 6) -}} {{- $reward := dict "enable" true "comment" $comment "mode" $mode -}}