jlelse
/
Indieroad
Archived
1
Fork 0
This repository has been archived on 2020-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
Indieroad/layouts/shortcodes/pswp-figure.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>