2021-07-03 10:30:48 +01:00
|
|
|
<div class="media list-page-item mb-3" data-id="{{ .File.UniqueID }}">
|
2017-10-27 22:56:44 +01:00
|
|
|
{{ if .Params.image }}
|
|
|
|
<div class="d-none d-md-block align-self-center img-wrapper mr-3">
|
2021-12-27 10:42:16 +00:00
|
|
|
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
2018-01-04 10:48:54 +00:00
|
|
|
{{ .Scratch.Set "image" .Params.image }}
|
|
|
|
{{ if hasPrefix .Params.image "resource:" }}
|
2018-01-24 19:55:48 +00:00
|
|
|
{{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }}
|
2022-01-03 14:52:13 +00:00
|
|
|
{{ .Scratch.Set "image" ($resource.Resize "200x webp").RelPermalink }}
|
2020-09-12 15:46:23 +01:00
|
|
|
{{ else if hasPrefix .Params.image "unsplash:" }}
|
|
|
|
{{ $unsplash_id := replace .Params.image "unsplash:" "" }}
|
|
|
|
{{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }}
|
|
|
|
{{ $unsplash_data := (getJSON "https://api.unsplash.com/photos/" $unsplash_id "?" $query )}}
|
|
|
|
{{ .Scratch.Set "image" $unsplash_data.urls.thumb }}
|
2018-01-04 10:48:54 +00:00
|
|
|
{{ end }}
|
2021-12-27 10:41:59 +00:00
|
|
|
<img src='{{ .Scratch.Get "image" }}' decoding="async" loading="lazy" referrerpolicy="no-referrer" alt="" />
|
2017-10-27 22:56:44 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
<div class="media-body">
|
2022-01-03 13:47:54 +00:00
|
|
|
<h3 class="my-0 h5">
|
|
|
|
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
|
|
|
|
{{ .Title }}
|
|
|
|
</a>
|
|
|
|
</h3>
|
2017-12-22 17:16:20 +00:00
|
|
|
<small>{{ partial "content-details.html" . }}</small>
|
2017-11-09 13:48:28 +00:00
|
|
|
<p>{{ partial "summary.html" . }}</p>
|
2017-10-27 22:56:44 +01:00
|
|
|
</div>
|
|
|
|
</div>
|