From e409c7112f4970c22cb46c333cd01cf2b5eb21b9 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Mon, 5 Aug 2024 16:49:43 +0200 Subject: [PATCH] Load JS and CSS for Asciinema only if params.asciinema is set to true in the frontmatter --- themes/hugo-theme-ipng/layouts/partials/head.html | 5 ++++- themes/hugo-theme-ipng/layouts/shortcodes/asciinema.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/hugo-theme-ipng/layouts/partials/head.html b/themes/hugo-theme-ipng/layouts/partials/head.html index df8d9b3..62bde11 100644 --- a/themes/hugo-theme-ipng/layouts/partials/head.html +++ b/themes/hugo-theme-ipng/layouts/partials/head.html @@ -3,7 +3,6 @@ {{ .Site.Title }} {{ with .Title }}- {{ . }} {{ end }} - {{ $options := dict "transpiler" "libsass" "targetPath" "css/styles.css" -}} {{ $style := resources.Get "styles.scss" | toCSS $options | minify | fingerprint -}} @@ -20,4 +19,8 @@ {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} + {{ if eq .Params.asciinema true -}} + + + {{- end }} diff --git a/themes/hugo-theme-ipng/layouts/shortcodes/asciinema.html b/themes/hugo-theme-ipng/layouts/shortcodes/asciinema.html index 0552f5f..42a7c52 100644 --- a/themes/hugo-theme-ipng/layouts/shortcodes/asciinema.html +++ b/themes/hugo-theme-ipng/layouts/shortcodes/asciinema.html @@ -1,2 +1,2 @@ -
+