diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html
index e5c4890a2..0b7eb3195 100644
--- a/layouts/_default/_markup/render-codeblock-mermaid.html
+++ b/layouts/_default/_markup/render-codeblock-mermaid.html
@@ -1,4 +1,4 @@
{{- .Inner | safeHTML }}
-{{- .Page.Scratch.SetInMap "this" "mermaid" true -}}
+{{- .Page.Scratch.Set "enableMermaid" true -}}
diff --git a/layouts/_default/_markup/render-passthrough.html b/layouts/_default/_markup/render-passthrough.html
index ab46d3f23..b5dd844dc 100644
--- a/layouts/_default/_markup/render-passthrough.html
+++ b/layouts/_default/_markup/render-passthrough.html
@@ -1,4 +1,4 @@
-{{- .Page.Scratch.SetInMap "this" "math" true -}}
+{{- .Page.Scratch.Set "enableMath" true -}}
{{- if eq .Type "block" -}}
{{- $opts := dict "displayMode" true "output" "html" -}}
{{- transform.ToMath .Inner $opts -}}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 75197ba91..4f267fdc8 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -89,7 +89,7 @@
{{- /* comment button */ -}}
- {{- if (.Page.Scratch.Get "this").commentEnabled -}}
+ {{- if .Page.Scratch.Get "enableComment" -}}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index ed8181d8c..8021c6b99 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,7 +1,7 @@
{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}}
{{- define "content" -}}
- {{- .Page.Scratch.SetInMap "this" "tablesort" true -}}
+ {{- .Page.Scratch.Set "enableTablesort" true -}}
{{- $params := .Scratch.Get "params" -}}
{{- /* Title */ -}}
diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html
index 612d85216..3f3647413 100644
--- a/layouts/partials/assets.html
+++ b/layouts/partials/assets.html
@@ -28,7 +28,7 @@
{{- end -}}
{{- /* tablesort */ -}}
-{{- if $params.table | and $params.table.sort | and (.Scratch.Get "this").tablesort -}}
+{{- if $params.table | and $params.table.sort | and (.Scratch.Get "enableTablesort") -}}
{{- $source := $cdn.tablesort | default "lib/tablesort/tablesort.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "sort" true | dict "table" | merge $config -}}
@@ -65,7 +65,7 @@
{{- end -}}
{{- /* Sharer.js */ -}}
-{{- if $params.share.enable | and (.Scratch.Get "this").sharer -}}
+{{- if $params.share.enable | and (.Scratch.Get "enableSharer") -}}
{{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "sharerjs" true | merge $config -}}
@@ -80,7 +80,7 @@
{{- end -}}
{{- /* KaTeX */ -}}
-{{- if (.Scratch.Get "this").math -}}
+{{- if .Scratch.Get "enableMath" -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
@@ -143,7 +143,7 @@
{{- end -}}
{{- /* mermaid */ -}}
-{{- if (.Scratch.Get "this").mermaid -}}
+{{- if .Scratch.Get "enableMermaid" -}}
*/ -}}
{{- $source := $cdn.tabsjs | default "lib/tabs/tabs.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true "Module" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* Music */ -}}
-{{- if (.Scratch.Get "this").aplayer | or (.Scratch.Get "this").music -}}
+{{- if (.Scratch.Get "enableAplayer") | or (.Scratch.Get "enableMusic") -}}
{{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
@@ -196,7 +196,7 @@
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
- {{- if (.Scratch.Get "this").music -}}
+ {{- if (.Scratch.Get "enableMusic") -}}
{{- /* MetingJS */ -}}
{{- $source := $cdn.metingJS | default "lib/meting/Meting.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
@@ -264,7 +264,7 @@
{{- end -}}
{{/* Custom style */}}
-{{- with (.Scratch.Get "this").styleArr -}}
+{{- with .Scratch.Get "styleArr" -}}
{{- $content := delimit . "" -}}
{{- $path := substr (md5 $content) 0 6 | printf "css/%v" -}}
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
@@ -286,7 +286,7 @@
{{- $_ := $js.RelPermalink -}}
{{- dict "Link" $js.RelPermalink "Fingerprint" $fingerprint "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
-{{- with (.Scratch.Get "this").scriptArr -}}
+{{- with .Scratch.Get "scriptArr" -}}
{{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
index ae1b54ee5..c04c18bd6 100644
--- a/layouts/partials/comment.html
+++ b/layouts/partials/comment.html
@@ -4,7 +4,7 @@
{{- $commentConfig := dict -}}
{{- if $comment.enable -}}
- {{- .Scratch.SetInMap "this" "commentEnabled" true -}}
+ {{- .Scratch.Set "enableComment" true -}}