{{ if .Page.Store.Get "hasMermaid" }}
  <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
  <script>
    const mermaidtheme = getStoredThemeStyle() === 'dark' ? 'dark' : 'base';
    mermaid.initialize({ startOnLoad: true, theme: mermaidtheme });
  </script>
{{ end }}
