27 lines
793 B
HTML
27 lines
793 B
HTML
{{ $keep := .keepOriginal}}
|
|
{{- $title := .ctx.Name -}}
|
|
{{- with .ctx.Title -}}
|
|
{{- $title = . -}}
|
|
{{- end -}}
|
|
{{- $alt := $title -}}
|
|
{{- with .ctx.Params.alt -}}
|
|
{{- $alt = . -}}
|
|
{{- end -}}
|
|
{{- $ctx := .ctx -}}
|
|
{{ with .image }}
|
|
{{ if eq $keep true }}
|
|
<img alt="{{ $alt }}"
|
|
title="{{ $title }}"
|
|
class="original"
|
|
src="{{ .RelPermalink }}" />
|
|
{{ else }}
|
|
{{- $imageSm := .Fill "300x300 Top" -}}
|
|
{{- $imageMd := .Fill "500x500 Top" -}}
|
|
<img alt="{{ $alt }}"
|
|
title="{{ $title }}"
|
|
srcset="{{ $imageSm.RelPermalink }} 300w, {{ $imageMd.RelPermalink }} 500w"
|
|
sizes="(max-width: 300px) 300px, 500px"
|
|
src="{{ $imageMd.RelPermalink }}" />
|
|
{{ end }}
|
|
{{- partial "schema/img.html" (dict "image" . "ctx" $ctx) -}}
|
|
{{ end }} |