MtF-wiki/layouts/shortcodes/doctor-image.html

7 lines
335 B
HTML
Raw Normal View History

2021-12-17 06:43:21 +08:00
{{- $img := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}}
{{- if gt $img.Width 200 }}{{ $img = $img.Resize "200x q90" }}{{ end -}}
{{- if gt $img.Height 270 }}{{ $img = $img.Resize "x270 q90" }}{{ end -}}
{{- with $img -}}
<img src="{{ .Permalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="Doctor">
{{- end -}}