mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
3e8bdfd8f9
* ⚡ Perf: adjust global/site scope state management * ⚡ Perf: adjust page scope state management
39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
{{- /* FixIt theme patches */ -}}
|
|
{{- $params := partial "function/params.html" -}}
|
|
|
|
{{- /* Toc data patch */ -}}
|
|
{{- $toc := $params.toc -}}
|
|
{{- if not (reflect.IsMap $toc) -}}
|
|
{{- $toc = dict "enable" $toc | merge .Site.Params.page.toc -}}
|
|
{{- end -}}
|
|
{{- .Store.Set "toc" $toc -}}
|
|
|
|
{{- /* Reward data patch */ -}}
|
|
{{- $reward := $params.reward -}}
|
|
{{- if eq $reward true -}}
|
|
{{- $reward = dict "enable" true | merge .Site.Params.page.reward -}}
|
|
{{- else if eq $reward false -}}
|
|
{{- $reward = dict "enable" false -}}
|
|
{{- end -}}
|
|
{{- .Store.Set "reward" $reward -}}
|
|
|
|
{{- /* KaTeX data patch */ -}}
|
|
{{- $math := $params.math -}}
|
|
{{- if eq $math true -}}
|
|
{{- $math = dict "enable" true | merge .Site.Params.page.math -}}
|
|
{{- else if eq $math false -}}
|
|
{{- $math = dict "enable" false -}}
|
|
{{- end -}}
|
|
{{- .Store.Set "math" $math -}}
|
|
|
|
{{- /* SiteTime config patch */ -}}
|
|
{{- $siteTime := dict "Animate" true "Icon" "fa-solid fa-heartbeat" -}}
|
|
{{- with .Site.Params.footer.siteTime -}}
|
|
{{- if reflect.IsMap . -}}
|
|
{{- $siteTime = . -}}
|
|
{{- else -}}
|
|
{{- $siteTime = dict "enable" true "value" . | merge $siteTime -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- .Site.Store.Set "siteTime" $siteTime -}}
|