Add exif hero images
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
25
layouts/_shortcodes/exif-image.html
Normal file
25
layouts/_shortcodes/exif-image.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ $src := "" }}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ $src = .Get "src" }}
|
||||
{{ else }}
|
||||
{{ $src = .Get 0 }}
|
||||
{{ end }}
|
||||
|
||||
{{ $title := "" }}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ $title = .Get "title" }}
|
||||
{{ else }}
|
||||
{{ $title = .Get 1 }}
|
||||
{{ end }}
|
||||
|
||||
{{ $alt := "" }}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ $alt = .Get "alt" }}
|
||||
{{ else }}
|
||||
{{ $alt = .Get 1 }}
|
||||
{{ end }}
|
||||
|
||||
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $src) }}
|
||||
{{ $caption := partial "components/image/exif.html" $data.original }}
|
||||
{{ partial "components/image/index.html" (merge $data (dict "caption" $caption "title" $title "alt" $alt)) }}
|
||||
{{- /* chomp trailing newline */ -}}
|
Reference in New Issue
Block a user