parent
89a0e7e353
commit
311a3b1370
3 changed files with 15 additions and 7 deletions
|
|
@ -9,8 +9,11 @@ An image on its own line becomes a figure; images sharing a paragraph get an inl
|
|||
{{- with or (.PageInner.Resources.Get (strings.TrimPrefix "./" .Destination)) (resources.Get .Destination) -}}
|
||||
{{- $src = .RelPermalink -}}
|
||||
{{- if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") -}}
|
||||
{{- $width = .Width -}}
|
||||
{{- $height = .Height -}}
|
||||
{{- /* Width and height as the browser shows the image, i.e. turned as its EXIF orientation
|
||||
says (only JPEG and TIFF carry one). */ -}}
|
||||
{{- $shown := cond (in (slice "jpeg" "tiff") .MediaType.SubType) (.Filter images.AutoOrient) . -}}
|
||||
{{- $width = $shown.Width -}}
|
||||
{{- $height = $shown.Height -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- /* A title that only repeats the alt text is not a credit. */ -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue