Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/shortcodes/gravizo.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/layouts/shortcodes/gravizo.html b/layouts/shortcodes/gravizo.html
new file mode 100644
index 0000000..a6c9fe7
--- /dev/null
+++ b/layouts/shortcodes/gravizo.html
@@ -0,0 +1,18 @@
+{{ $title := "Diagram" }}
+{{ if .IsNamedParams }}
+ {{ with .Get "title" }}
+ {{ $title = . }}
+ {{ end }}
+{{ else }}
+ {{ with .Get 0 }}
+ {{ $title = . }}
+ {{ end }}
+{{ end }}
+
+<figure>
+ <img
+ src='https://g.gravizo.com/svg?{{ .Inner }}'
+ alt='{{ $title }}'
+ />
+ <figcaption>{{ $title }}</figcaption>
+</figure>