{{- $page := .page }}
{{- $location := .location }}
{{- if eq $location "footer" }}
{{- with $page }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
{{- if and (isset .Params "custommermaidurl") .Params.customMermaidURL }}
{{- else if and (isset .Site.Params "custommermaidurl") .Site.Params.customMermaidURL }}
{{- else }}
{{- end }}
{{- $init := "{}" }}
{{- if isset .Params "mermaidinitialize" }}
{{- $init = .Params.mermaidInitialize }}
{{- else if isset .Site.Params "mermaidinitialize" }}
{{- $init = .Site.Params.mermaidInitialize }}
{{- end }}
{{- end }}
{{- end }}