2019-09-24 14:50:06 +00:00
|
|
|
{{- with .page.Resources.ByType "image" }}
|
|
|
|
{{- $link := $.link -}}
|
|
|
|
{{- $IsSingle := $.IsSingle -}}
|
|
|
|
{{- $match := $.page.Params.featured -}}
|
|
|
|
{{- $featuredMap := "" -}}
|
|
|
|
|
|
|
|
{{- $IsMap := reflect.IsMap $match -}}
|
|
|
|
{{- if $IsMap }}
|
|
|
|
{{- $featuredMap = $match -}}
|
|
|
|
{{- $match = $match.url -}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- $featured := .GetMatch ($match | default "{featured.*,thumbnail.*}") -}}
|
|
|
|
{{ if and $featured (not (and $IsSingle ($.page.Param "featured.previewOnly"))) }}
|
2020-02-11 14:22:46 +00:00
|
|
|
<figure class="entry__featured featured">
|
2019-09-24 14:50:06 +00:00
|
|
|
{{- with $link }}<a class="featured__link" href="{{ . }}">{{ end }}
|
|
|
|
<img class="featured__img" src="{{ $featured.RelPermalink }}" alt="
|
|
|
|
{{- with $featuredMap -}}
|
|
|
|
{{- .alt | default $featured.Title -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $featured.Title -}}
|
|
|
|
{{- end -}}
|
|
|
|
"/>
|
|
|
|
{{- with $link }}</a>{{ end }}
|
|
|
|
{{- with $IsSingle }}
|
|
|
|
{{- with $featuredMap }}
|
|
|
|
{{- if or .caption .credit }}
|
|
|
|
<figcaption class="featured__figcaption">
|
|
|
|
{{- with .caption }}
|
|
|
|
<div class="featured__caption">{{ . | markdownify }}</div>
|
|
|
|
{{- end }}
|
|
|
|
{{- with .credit }}
|
|
|
|
<cite class="featured__credit">{{ . | markdownify }}</cite>
|
|
|
|
{{- end }}
|
|
|
|
</figcaption>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
</figure>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|