mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 10:14:53 +00:00
Provide examples of content rendering before accessing Scratch or Store
Closes #2402
This commit is contained in:
1 parent
0206b9699b
commit
a3184764d7
5 files changed
+56
-2
No files matched your search
@@ -122,7 +122,7 @@ For example, to create a code block render hook to render [Mermaid] diagrams:
|
||||
Then include this snippet at the bottom of the your base template:
|
||||
|
||||
{{< code file=layouts/_default/baseof.html copy=true >}}
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
{{ if .Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
|
||||
Reference in new issue
Block a user