12345678910111213141516171819202122232425262728 |
- {{ $src := .Get "src"}}
- {{ $image := (.Page.Resources.ByType "image").GetMatch (printf "**%s**" $src) -}}
- <figure class="big">
- <img src="{{$src}}" loading="lazy"
- {{- if or (.Get "alt") (.Get "caption") }}
- alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
- {{- end -}}
- {{- with $image.Width }} width="{{ . }}"{{ end -}}
- {{- with $image.Height }} height="{{ . }}"{{ end -}}
- /><!-- Closing img tag -->
- <figcaption>
- {{- with (.Get "title") -}}
- <h4>{{ . }}</h4>
- {{ end -}}
- {{ if or (.Get "caption") $image.Exif -}}
- <p>
- {{ with $image.Exif -}}
- <span>【
- {{- with .Tags.FocalLength }}{{.}}mm{{ end -}}
- {{ with .Tags.ApertureValue }}, ƒ/{{ lang.FormatNumber 1 . }}{{ end -}}
- {{ with .Tags.ExposureTime }}, {{.}}s{{ end -}}
- {{ with .Tags.ISO }}, ISO{{.}}{{ end }}】</span>
- {{- end -}}
- {{- .Get "caption" | markdownify -}}
- </p>
- {{ end -}}
- </figcaption>
- </figure>
|