mirror of
https://github.com/Vimux/Binario.git
synced 2024-12-23 13:09:05 +00:00
7bffa43920
* .Site.Params.post_meta → .Site.Params.Entry.meta * .Site.Params.toc → .Site.Params.Entry.toc * .Site.Params.tocOpen → .Site.Params.Entry.tocOpen
41 lines
No EOL
1.3 KiB
HTML
41 lines
No EOL
1.3 KiB
HTML
{{- 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"))) }}
|
|
<figure class="entry__featured featured">
|
|
{{- 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 }} |