Add optional mermaid shortcode (#551)

* add optional mermaid shotcode

* Use page level configuration for mermaid + use local file

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Fix comment

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
Co-authored-by: Emruz Hossain <emruz@appscode.com>
This commit is contained in:
James Ray 2022-03-13 11:53:27 -04:00 committed by GitHub
parent 8caa12724e
commit c89fe66332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,13 @@
{{ $alignment:= .Get "align"}}
{{ if not $alignment }}
{{ $alignment = "center"}}
{{ end }}
{{ $background:= .Get "background" }}
{{ if not $background }}
{{ $background = "none"}}
{{ end }}
<div class="mermaid" align="{{ $alignment }}" style="background-color: {{ $background }}; border-radius: 5px;">
{{ safeHTML .Inner }}
</div>