From 25c454d5c867886a940f996518b77ed0a56d35c7 Mon Sep 17 00:00:00 2001 From: CharlesPhilippeLabbe Date: Fri, 6 Jun 2025 15:57:00 -0400 Subject: [PATCH 1/2] Added support for ```mermaid --- layouts/_default/_markup/render-codeblock-mermaid.html | 4 ++++ layouts/_default/baseof.html | 6 ++++++ 2 files changed, 10 insertions(+) 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..42e8abf --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +
+  {{ .Inner | htmlEscape | safeHTML }}
+
+{{ .Page.Store.Set "hasMermaid" true }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a6c4c07..87fc09e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -81,3 +81,9 @@ {{ define "toc" }} {{ partial "docs/toc" . }} {{ end }} +{{ if .Store.Get "hasMermaid" }} + +{{ end }} From 5a609d33fc45c144e0c82a8a6fed022d90649272 Mon Sep 17 00:00:00 2001 From: CharlesPhilippeLabbe Date: Fri, 6 Jun 2025 16:11:30 -0400 Subject: [PATCH 2/2] Fixed issue when no shortcode mermaid is present --- layouts/_default/baseof.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 87fc09e..f8f845f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -82,8 +82,8 @@ {{ partial "docs/toc" . }} {{ end }} {{ if .Store.Get "hasMermaid" }} + {{ end }}