handle SVG and GIF

This commit is contained in:
Ben Goldsworthy 2023-04-13 17:40:11 -06:00
parent f9aaff71c0
commit 94e336cc1e

View file

@ -4,7 +4,7 @@
{{ $src := $.Page.Resources.GetMatch (.Get "src") }}
{{ if ( not $src ) }}
{{- errorf "No Page Resource found for src '%v' for post '%v'" ( .Get "src" ) $.Page.Title -}}
{{- errorf "No Page Resource found for src '%v' for post '%v'" ( .Get "src" ) $.File.Path -}}
{{ end }}
{{ $linkedResource := $.Page.Resources.GetMatch (.Get "link") }}
@ -37,7 +37,7 @@
{{- if eq $src.ResourceType "image" -}}
<picture class="figure__picture">
<img class="figure__image"
{{ if eq $src.MediaType.SubType "svg" }}
{{ if ( or ( eq $src.MediaType.SubType "svg" ) ( eq $src.MediaType.SubType "gif" ) ) }}
src="{{ $src.RelPermalink }}"
{{ else }}
{{ with $src.Resize "1500x webp" }}