From 4de8eed657f5756d96e1cd3a3a6926c700f942e0 Mon Sep 17 00:00:00 2001
From: james_lin <james.lin@canonical.com>
Date: Mon, 25 Jul 2022 22:47:44 +0000
Subject: [PATCH] feat(layouts/shortcodes/mermaid.html-layouts/_default/baseof.html): A… (#595)

---
 layouts/_default/baseof.html                 |    2 +-
 layouts/shortcodes/mermaid.html              |    3 +++
 exampleSite/content/posts/mermaid-support.md |   33 +++++++++++++++++++++++++++++++++
 CONTRIBUTORS.md                              |    1 +
 4 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index e5f88ca..48f9893 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -114,3 +114,4 @@
 - [George Tsiokos](https://george.tsiokos.com)
 - [Eltjo](https://github.com/eltjo)
 - [Saurmandal](https://saur.neocities.org)
+- [Jneo8](https://github.com/jneo8)
diff --git a/exampleSite/content/posts/mermaid-support.md b/exampleSite/content/posts/mermaid-support.md
new file mode 100644
index 0000000..170172b
--- /dev/null
+++ b/exampleSite/content/posts/mermaid-support.md
@@ -0,0 +1,33 @@
++++
+date = "2022-07-25"
+title = "Mermaid JS support"
+description = "The post demonstrates Mermaid JS support"
+series = ["Theme", "Hugo"]
++++
+
+If you want to use [Mermaid-JS](https://mermaid-js.github.io/mermaid/#/) on your website.
+Provide `mermaid` as [Shortcode](https://gohugo.io/content-management/shortcodes/#readout) in your markdown file.
+
+
+{{<mermaid>}}
+flowchart LR
+
+    A --> B
+
+    B --> C
+
+    C --> D 
+
+    D --> B
+{{</mermaid>}}
+
+{{<mermaid>}}
+sequenceDiagram
+    participant Alice
+    participant Bob
+    Alice->>Bob: Hi Bob
+    Bob->>Alice: Hi Alice
+{{</mermaid>}}
+
+
+Find more example on [Mermaid-JS](https://mermaid-js.github.io/mermaid/#/) website.
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 19df409..1cd58bf 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -67,7 +67,7 @@
 
   {{ if and .Site.Params.applicationInsights .Site.Params.applicationInsights.connectionString }}
     {{- partial "analytics/applicationinsights" . -}}
-  {{ end }}   
+  {{ end }}
 
   {{- partial "body/extensions" . -}}
 </body>
diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html
new file mode 100644
index 0000000..85166b1
--- /dev/null
+++ b/layouts/shortcodes/mermaid.html
@@ -0,0 +1,3 @@
+<div class="mermaid">
+  {{- .Inner | safeHTML }}
+</div>

--
Gitblit v1.10.0