20 lines
863 B
HTML
20 lines
863 B
HTML
|
{{- $gridSize := $.Site.Params.photos.thumbnailSize -}}
|
||
|
{{- $thumbnail := partial "photostream/thumbnail.html" (dict "Page" . "Width" $gridSize "Height" $gridSize) -}}
|
||
|
{{- $thumbnail = $thumbnail.Crop (printf "%dx%d" $gridSize $gridSize) -}}
|
||
|
{{- $altText := $thumbnail.Params.alt -}}
|
||
|
{{- $linkTitle := .LinkTitle | markdownify -}}
|
||
|
{{- $showsTitle := le (len $linkTitle) 18 -}}
|
||
|
<article class="photostream-item">
|
||
|
{{ if $showsTitle }}
|
||
|
<h3 class="photostream-item__title">{{ $linkTitle }}</h3>
|
||
|
{{ end }}
|
||
|
<a href="{{ .RelPermalink }}"
|
||
|
{{- if not $showsTitle }} title="{{ .Title | markdownify }}"{{ end }}>
|
||
|
<img
|
||
|
class="photostream-item__thumbnail"
|
||
|
src="{{ $thumbnail.RelPermalink }}"
|
||
|
{{- with $altText }} alt="{{ . }}"{{ end }}>
|
||
|
</a>
|
||
|
<time class="photostream-item__date">{{ .Date | time.Format "2006-01-02" }}</time>
|
||
|
</article>
|