{{- /* 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 -}}
