fix singleview con featured svg (#102)
Reviewed-on: #102 Co-authored-by: paspo <paolo@asperti.com> Co-committed-by: paspo <paolo@asperti.com>
This commit is contained in:
parent
c050d29aa3
commit
888aaedb58
@ -11,6 +11,7 @@
|
||||
{{- if or .Params.image .Params.featured }}
|
||||
|
||||
{{- $maxHeight := 600 -}}
|
||||
{{ $rasters := slice "jpeg" "png" }}
|
||||
{{- $img := "#" -}}
|
||||
|
||||
{{- if .Params.image -}}
|
||||
@ -23,10 +24,13 @@
|
||||
{{- $img = .Page.Resources.GetMatch .Params.featured -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $image := $img.Resize (printf "x%d" $maxHeight) -}}
|
||||
|
||||
<span class="image featured">
|
||||
<img src="{{ $image.RelPermalink }}" alt="{{ .Params.image_alt }}" style="width: {{ $image.Width }}px; max-height: {{ $maxHeight }}px;" />
|
||||
{{- if in $rasters $img.MediaType.SubType -}}
|
||||
{{- $img = $img.Resize (printf "x%d" $maxHeight) -}}
|
||||
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="width: {{ $img.Width }}px; max-height: {{ $maxHeight }}px;" />
|
||||
{{ else }}
|
||||
<img src="{{ $img.RelPermalink }}" alt="{{ .Params.image_alt }}" style="max-height: {{ $maxHeight }}px;" />
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user