Added support for ```mermaid (#729)
* Added support for ```mermaid * Fixed issue when no shortcode mermaid is present * Change block render to match shortcode * Remove mermaid logic from base --------- Co-authored-by: CharlesPhilippeLabbe <c.p@o-possum.com> Co-authored-by: Alex Shpak <alex-shpak@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{{ if not (.Page.Store.Get "mermaid") }}
|
||||
<!-- Include mermaid only first time -->
|
||||
<script src="{{ "mermaid.min.js" | relURL }}"></script>
|
||||
{{ with resources.Get "mermaid.json" }}
|
||||
<script>mermaid.initialize({{ .Content | safeJS }})</script>
|
||||
{{ end }}
|
||||
{{ .Page.Store.Set "mermaid" true }}
|
||||
{{ end }}
|
||||
|
||||
<pre class="mermaid">
|
||||
{{- .Inner -}}
|
||||
</pre>
|
||||
Reference in New Issue
Block a user