handle SVG and GIF
This commit is contained in:
parent
f9aaff71c0
commit
94e336cc1e
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
{{ $src := $.Page.Resources.GetMatch (.Get "src") }}
|
{{ $src := $.Page.Resources.GetMatch (.Get "src") }}
|
||||||
{{ if ( not $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 }}
|
{{ end }}
|
||||||
{{ $linkedResource := $.Page.Resources.GetMatch (.Get "link") }}
|
{{ $linkedResource := $.Page.Resources.GetMatch (.Get "link") }}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
{{- if eq $src.ResourceType "image" -}}
|
{{- if eq $src.ResourceType "image" -}}
|
||||||
<picture class="figure__picture">
|
<picture class="figure__picture">
|
||||||
<img class="figure__image"
|
<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 }}"
|
src="{{ $src.RelPermalink }}"
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with $src.Resize "1500x webp" }}
|
{{ with $src.Resize "1500x webp" }}
|
||||||
|
|
Loading…
Reference in a new issue