diff options
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/_markup/render-codeblock-mermaid.html | 4 | ||||
-rw-r--r-- | layouts/_default/_markup/render-image.html | 5 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..d32626f --- /dev/null +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +<pre class="mermaid"> + {{- .Inner | htmlEscape | safeHTML }} +</pre> +{{ .Page.Store.Set "hasMermaid" true }}
\ No newline at end of file diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 93e530d..b2ccc08 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,3 +1,5 @@ +<figure class="figure"> + <img class="d-block img-fluid mb-2 rounded border shadow" max-width="800" @@ -6,3 +8,6 @@ {{- with .Text }} alt="{{ . }}"{{ end -}} {{- with .Title }} title="{{ . }}"{{ end -}} > +{{- with .Title }}<figcaption class="figure-caption">{{.}}</figcaption>{{end -}} + +</figure>
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 313ce06..289d824 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,4 +14,10 @@ {{ block "main" . }}{{ end }} {{ partial "footer.html" . }} </body> +{{ if .Store.Get "hasMermaid" }} + <script type="module"> + import mermaid from '/js/mermaid.esm.min.mjs'; + mermaid.initialize({ startOnLoad: true }); + </script> +{{ end }} </html> |