From 87a8694716113dca8e27afe9e7a12bf72f14f237 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Tue, 6 May 2025 19:27:21 +0200 Subject: [PATCH] handle audio figures --- layouts/shortcodes/figure.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 66e9bd4..398ac9e 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -14,7 +14,7 @@ -{{- if not ( in ( slice "image" "video" ) $src.ResourceType ) -}} +{{- if not ( in ( slice "audio" "image" "video" ) $src.ResourceType ) -}} {{- errorf "Resource '%q' resource type '%q' is not valid (%q)" ( .Get "src" ) $src.ResourceType .Page.File.Path -}} {{- end -}} @@ -42,15 +42,12 @@ {{- if eq $src.ResourceType "image" -}} {{- partial "media/picture.html" $src -}} - {{- else if eq $src.ResourceType "video" -}} - {{- if eq $src.MediaType "video/ogg" -}} + {{- else if eq $src.ResourceType "audio" -}} {{- partial "media/audio.html" $src -}} - {{- else -}} + {{- else if eq $src.ResourceType "video" -}} {{- partial "media/video.html" ( dict "src" $src "page_file_path" .Page.File.Path ) -}} - {{- end -}} - {{- else if ( or ( ne $src.ResourceType "image" ) ( ne $src.ResourceType "video" ) ) -}} {{- errorf "No handling for resource of type %q" $src.ResourceType -}} {{- end -}}