mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-23 06:55:43 -06:00
19520b4481
Also added ability to set author image as external url and updated relevant documentation in configuration
34 lines
No EOL
1.6 KiB
HTML
34 lines
No EOL
1.6 KiB
HTML
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
|
|
|
{{- $images := .Resources.ByType "image" -}}
|
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
|
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
|
{{ $caption := "" }}
|
|
{{ if .Params.featureimage }}
|
|
{{- $url:= .Params.featureimage -}}
|
|
{{- $caption = .Params.featureimagecaption -}}
|
|
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
|
|
{{ end }}
|
|
{{- $alt := .Page.Title -}}
|
|
{{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}}
|
|
{{- with $featured -}}
|
|
{{ if $disableImageOptimization }}
|
|
{{ with . }}
|
|
<figure>
|
|
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
|
{{ if $caption }}
|
|
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline" style="text-align: center;"> {{ $caption | markdownify }} </figcaption>
|
|
{{end}}
|
|
</figure>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ with .Resize "1200x" }}
|
|
<figure>
|
|
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
|
{{ if $caption }}
|
|
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline" style="text-align: center;"> {{ $caption | markdownify }} </figcaption>
|
|
{{end}}
|
|
</figure>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{- end -}} |