{{- if .Store.Get "hasMermaid" -}} {{- $cfg := site.Params.article.mermaid | default dict -}}
{{- $opts := dict "minify" hugo.IsProduction "format" "esm" -}} {{- $script := resources.Get "ts/mermaid.ts" | js.Build $opts -}} {{- $jsConfig := dict "transparentBackground" ($cfg.transparentBackground | default false) "lightTheme" ($cfg.lightTheme | default "default") "darkTheme" ($cfg.darkTheme | default "dark") "lightThemeVariables" ($cfg.lightThemeVariables | default dict) "darkThemeVariables" ($cfg.darkThemeVariables | default dict) "securityLevel" ($cfg.securityLevel | default "strict") "look" ($cfg.look | default "classic") "htmlLabels" (not (eq ($cfg.htmlLabels | default true) false)) -}} {{- with $cfg.maxTextSize }}{{ $jsConfig = merge $jsConfig (dict "maxTextSize" .) }}{{ end -}} {{- with $cfg.maxEdges }}{{ $jsConfig = merge $jsConfig (dict "maxEdges" .) }}{{ end -}} {{- with $cfg.fontSize }}{{ $jsConfig = merge $jsConfig (dict "fontSize" .) }}{{ end -}} {{- with $cfg.fontFamily }}{{ $jsConfig = merge $jsConfig (dict "fontFamily" .) }}{{ end -}} {{- with $cfg.curve }}{{ $jsConfig = merge $jsConfig (dict "curve" .) }}{{ end -}} {{- with $cfg.logLevel }}{{ $jsConfig = merge $jsConfig (dict "logLevel" .) }}{{ end -}} {{- end -}}