Embed the image of a photo post link in a <figure>
This commit is contained in:
parent
e65a680b49
commit
b72441b9b1
1 changed files with 6 additions and 3 deletions
|
@ -1,9 +1,12 @@
|
||||||
{{- with $photoPage := $.Page.GetPage (printf "photos/%s" (.Get 0)) -}}
|
{{- with $photoPage := $.Page.GetPage (printf "photos/%s" (.Get 0)) -}}
|
||||||
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
|
{{- $thumbnail := partial "photos/thumbnail.html" (dict "Page" . "Width" 1280 "Height" 1280) -}}
|
||||||
{{- $altText := $thumbnail.Params.alt | default .Title -}}
|
{{- $altText := $thumbnail.Params.alt | default .Title -}}
|
||||||
|
<figure class="figure figure--image">
|
||||||
<a class="to-photo-post" href="{{ .RelPermalink }}" title="{{ .Title }}">
|
<a class="to-photo-post" href="{{ .RelPermalink }}" title="{{ .Title }}">
|
||||||
<img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
|
<img src="{{ $thumbnail.RelPermalink }}"{{ with $altText }} alt="{{ . }}"{{ end }}>
|
||||||
</a>
|
</a>
|
||||||
|
<figcaption>{{ .Title }}</figcaption>
|
||||||
|
</figure>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- errorf "No page matching '%s'" (.Get 0) -}}
|
{{- errorf "No page matching '%s'" (.Get 0) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue