From d9350b842445ea94ee40d99b382d12be1f406d7f Mon Sep 17 00:00:00 2001 From: David Gallay Date: Sat, 13 Aug 2022 23:44:44 +0200 Subject: [PATCH] added support for charts --- .../_markup/render-codeblock-mermaid.html | 4 ++++ layouts/_default/baseof.html | 15 +++++++++++++++ layouts/shortcodes/chart.html | 17 +++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 layouts/_default/_markup/render-codeblock-mermaid.html create mode 100644 layouts/shortcodes/chart.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..2ed7001 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +
+ {{- .Inner | safeHTML }} +
+{{ .Page.Store.Set "hasMermaid" true }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3d13f07..4dc84f4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -19,5 +19,20 @@ {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} +{{ if .Page.Store.Get "hasMermaid" }} + + +{{ end }} +{{/* {{ if .Page.Store.Get "hasChart" }} + +{{ end }} */}} + diff --git a/layouts/shortcodes/chart.html b/layouts/shortcodes/chart.html new file mode 100644 index 0000000..be1aa04 --- /dev/null +++ b/layouts/shortcodes/chart.html @@ -0,0 +1,17 @@ +
+

TEST

+ + + +
+{{/* {{ .Page.Store.Set "hasChart" true }} */}}