13 lines
689 B
HTML
13 lines
689 B
HTML
{{ $src := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
|
{{ $thumb := $src.Fill "500x500" }}
|
|
<div class="box">
|
|
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
|
|
<div class="img"{{ if .Parent }} style="background-image: url('{{ $thumb.RelPermalink }}');"{{ end }}>
|
|
<img itemprop="thumbnail" src="{{ $thumb.RelPermalink }}" {{ with .Get "caption" }}alt="{{ . | markdownify }}"{{ end }}/>
|
|
</div>
|
|
<a href="{{ $src.RelPermalink }}" itemprop="contentUrl" data-size="{{ $src.Width }}x{{ $src.Height }}"></a>
|
|
{{ with .Get "caption" }}
|
|
<figcaption><p>{{ . | markdownify }}</p></figcaption>
|
|
{{ end }}
|
|
</figure>
|
|
</div> |