portfolio/themes/warwick_portfolio/layouts/_default/summary.html
2024-06-27 15:28:32 +01:00

37 lines
1.1 KiB
HTML

<div class="item">
<div style="justify-content: space-between; flex-wrap:nowrap" class="flex-wrap-container">
<div class="summary">
<a class="summary__link" href="{{ .Permalink }}">
{{ if gt (len .Title) 40}}
<h4 style="margin: 0">{{slicestr .Title 0 40}}...</h4>
{{ else }}
<h4 style="margin: 0">{{ .Title }}</h4>
{{ end }}
{{- partial "taglist.html" . -}}
</a>
{{ if gt (len .Summary) 500 }}
<p>{{slicestr .Summary 0 500 | safeHTML}}...</p>
{{ else }}
<p>{{.Summary | safeHTML}}</p>
{{ end }}
<span class="summary__date">
{{ .Params.date.Format "2 January 2006" }} &middot; {{ .ReadingTime }} mins
</span>
</div>
{{ if .Params.thumbnail }}
{{- $image := resources.Get .Params.thumbnail -}}
{{ if $image }}
<div class="summary__img_container" style="align-self: center">
<a style="display: block" href="{{ .Permalink }}">
<img
class="summary__img"
src="{{ ($image.Fill "600x200 q100 Center").RelPermalink }}"
>
</a>
</div>
{{ end }}
{{ end }}
</div>
</div>