♻️ Refactor: global/site/page scope state management (#610)

*  Perf: adjust global/site scope state management

*  Perf: adjust page scope state management
This commit is contained in:
Cell
2025-07-03 12:34:28 +08:00
parent d9043280fe
commit 3e8bdfd8f9
42 changed files with 165 additions and 173 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
{{- /* Content */ -}}
{{- $content := .Inner | .Page.RenderString -}}
{{- /* Content Encryption */ -}}
{{- dict "Content" $content "Password" $password "Message" $message "IsPartial" true | partial "plugin/fixit-encryptor.html" -}}
{{- dict "Content" $content "Password" $password "Message" $message "IsPartial" true "Page" .Page | partial "plugin/fixit-encryptor.html" -}}
{{- else -}}
{{- .Inner -}}
{{- end -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $id := dict "Scratch" .Page.Scratch | partial "function/id.html" -}}
{{- $id := dict "Page" .Page | partial "function/id.html" -}}
{{- $wechatpay := (.Get "wechatpay") | default (.Get 0) -}}
{{- $alipay := (.Get "alipay") | default (.Get 1) -}}
{{- $paypal := (.Get "paypal") | default (.Get 2) -}}
+1 -1
View File
@@ -1,5 +1,5 @@
{{- $content := .Inner | .Page.RenderString -}}
{{- $id := dict "Scratch" .Page.Scratch | partial "function/id.html" -}}
{{- $id := dict "Page" .Page | partial "function/id.html" -}}
{{- $tag := .Get 1 | default "div" -}}
{{- printf `<%v id="%v">%v</%v>` $tag $id $content $tag | safeHTML -}}