From 7a7c68d17773a38c99db8f458216fe43a57c8259 Mon Sep 17 00:00:00 2001 From: simon-siggaard Date: Fri, 20 Sep 2024 14:22:07 +0200 Subject: [PATCH] add support for Mermaid diagrams --- layouts/_default/_markup/render-codeblock-mermaid.html | 4 ++++ layouts/_default/single.html | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/_markup/render-codeblock-mermaid.html diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..bb7bf42 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +
+  {{- .Inner | safeHTML }}
+
+{{ .Page.Store.Set "hasMermaid" true }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9282d4e..000977a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -70,6 +70,14 @@

{{ .Title }}

{{ end }} + {{ if .Store.Get "hasMermaid" }} + + {{ end }} + + {{/* Next prev controls */}} {{ if not (.Param "hidePagination") }} @@ -88,4 +96,4 @@

{{ .Title }}

-{{ end }} +{{ end }} \ No newline at end of file