1
0
mirror of https://github.com/lxndrblz/anatole.git synced 2022-06-11 21:08:13 +03:00

feat: added mermaid support for displaying diagrams (#359)

* add mermaid support for making diagrams

Co-authored-by: Jeffrey Forman <jforman@gmail.com>
Co-authored-by: Alexander Bilz <mail@alexbilz.com>
This commit is contained in:
Jeffrey Forman
2022-05-21 05:47:30 -04:00
committed by GitHub
parent c0c367c2de
commit d511a6f520
5 changed files with 21 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ Anatole's aims to be minimalistic and sleek but still brings some great function
- Custom JavaScript and CSS (optional)
- Compliant to strict CSP
- Post Series
- Mermaid diagram support (optional)
## Preview the Example Site

View File

@@ -73,3 +73,6 @@ url = "https://www.instagram.com/"
icon = "fas fa-envelope"
title = "e-mail"
url = "mailto:mail@example.com"
[mermaid]
# enable = true

View File

@@ -0,0 +1,4 @@
<div class="mermaid">
{{- .Inner | safeHTML }}
</div>
{{ .Page.Store.Set "hasMermaid" true }}

View File

@@ -67,6 +67,12 @@
{{- partial "contact.html" . -}}
{{- end -}}
{{- if (eq .Site.Params.mermaid.enable true) -}}
{{- partial "mermaid.html" . -}}
{{- end -}}
</div>
<div class="post__footer">

View File

@@ -0,0 +1,7 @@
{{ if .Page.Store.Get "hasMermaid" }}
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
{{ end }}