handle audio figures

This commit is contained in:
Ben Goldsworthy 2025-05-06 19:27:21 +02:00
parent ff9c90f68b
commit 87a8694716
No known key found for this signature in database

View file

@ -14,7 +14,7 @@
<!-- Validation -->
{{- 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 -}}