diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-03-01 11:56:07 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-03-01 11:56:07 +0100 |
commit | 97b010f521e592b5fc29daace225476b64543643 (patch) | |
tree | ddccebf102a88fb3f8c936dd9178f2ae02d3693e /docs/layouts | |
parent | 4d36b99a4e119594cb658a8796b18fc13b0672bc (diff) | |
parent | 336622d5e7afd9334cd2de7150d4f16bdf7c24f9 (diff) |
Merge commit '336622d5e7afd9334cd2de7150d4f16bdf7c24f9'
Diffstat (limited to 'docs/layouts')
-rw-r--r-- | docs/layouts/_default/_markup/render-codeblock-mermaid.html | 4 | ||||
-rw-r--r-- | docs/layouts/partials/hooks/before-body-end.html | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/layouts/_default/_markup/render-codeblock-mermaid.html b/docs/layouts/_default/_markup/render-codeblock-mermaid.html index 59641551c..94ea0cad0 100644 --- a/docs/layouts/_default/_markup/render-codeblock-mermaid.html +++ b/docs/layouts/_default/_markup/render-codeblock-mermaid.html @@ -1,4 +1,4 @@ -<div class="mermaid"> +<pre class="mermaid"> {{- .Inner | safeHTML }} -</div> +</pre> {{ .Page.Store.Set "hasMermaid" true }} diff --git a/docs/layouts/partials/hooks/before-body-end.html b/docs/layouts/partials/hooks/before-body-end.html index fb7ae20ba..dab653508 100644 --- a/docs/layouts/partials/hooks/before-body-end.html +++ b/docs/layouts/partials/hooks/before-body-end.html @@ -1,6 +1,7 @@ {{ if .Page.Store.Get "hasMermaid" }} - <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> - <script> + <script type="module" async> + import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/+esm'; + mermaid.initialize({ startOnLoad: true }); </script> {{ end }} |