31 lines
1.0 KiB
HTML
31 lines
1.0 KiB
HTML
{{- $title := .ctx.Title -}}
|
|
{{- $alt := .ctx.Params.alt -}}
|
|
{{- $description := .ctx.Params.description | markdownify -}}
|
|
{{- $keep := .keepOriginal -}}
|
|
{{- $class := .class -}}
|
|
{{- $href := .ctx.Params.href }}
|
|
|
|
<figure {{- with .class }} class="{{ . }}"{{- end -}}>
|
|
<a href="{{- with $href -}}{{ . }}{{ else }}{{ .ctx.Permalink }}{{ end }}"{{- with .lightbox }} data-lightbox{{- end -}}>
|
|
{{- partial "img.html" (dict "image" .image "ctx" .ctx "keepOriginal" $keep "class" $class) -}}
|
|
</a>
|
|
<figcaption class="description">
|
|
{{- if .showTitle -}}
|
|
{{- if $href -}}
|
|
<a href="{{$href}}"><h3>{{ $title }}</h3></a>
|
|
{{- else -}}
|
|
<h3>{{ $title }}</h3>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if .showDescription -}}
|
|
<p>
|
|
{{- with $description -}}
|
|
{{- . -}}
|
|
{{- else -}}
|
|
{{- $alt -}}
|
|
{{- end -}}
|
|
</p>
|
|
{{- end -}}
|
|
</figcaption>
|
|
</figure>
|