From 3446aa423004841b5f1c4eb88db5530be36fb606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 30 Oct 2021 20:31:52 +0200 Subject: [PATCH] mermaid: only load javascript if necessary #95 --- exampleSite/content/_index.pir.md | 5 +++++ layouts/partials/footer.html | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/_index.pir.md b/exampleSite/content/_index.pir.md index a7a41f949c..a46fc02a8f 100644 --- a/exampleSite/content/_index.pir.md +++ b/exampleSite/content/_index.pir.md @@ -1,4 +1,9 @@ +++ title = "Relearrrn Theme fer Cap'n Hugo" +++ + +{{% notice warning %}} +Arrr fello pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of contents orrr seeing Merrrmaids. +{{% /notice %}} + {{< piratify >}} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 62855916e5..35c3c6d2a4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -25,6 +25,7 @@ +{{- if .HasShortcode "mermaid" }} {{- if (or (and (ne .Params.disableMermaid nil) (not .Params.disableMermaid)) (not .Site.Params.disableMermaid)) }} {{- if isset .Params "custommermaidurl" }} @@ -40,11 +41,13 @@ {{- else }} {{- $.Scratch.Set "mermaidInitialize" "{ \"startOnLoad\": true }" }} {{- end }} - +{{- end }} {{- end }} {{- partial "custom-footer.html" . }}