speedtech-website/layouts/partials/widgets/article.html
2024-10-04 11:58:15 +02:00

25 lines
842 B
HTML

<div class="article-wrapper">
{{ if isset .Params "images"}}
{{ if (fileExists (printf "assets/%s" (index .Params.images 0))) -}}
{{ $articleimage := resources.Get (index .Params.images 0) }}
{{ $articleimage := $articleimage.Resize "200x" }}
<a href="{{ .Permalink }}">
<img class="img-fluid" style="padding: 6px; border: 1px solid #ddd" src="{{ $articleimage.RelPermalink }}"
width="{{ $articleimage.Width }}" height="{{ $articleimage.Height }}" alt="{{ .Title }}" class="img-fluid"
title="{{ .Title }}">
</a>
{{- end }}
{{- end }}
<div class="caption" style="max-width: 250px; margin: auto;">
<div class="caption-text">
<a class="text-title" style="font-weight: 400; font-size: 14px;" href="{{ .Permalink }}">
{{ .Title }}</a>
</div>
<div class="caption-bg"></div>
</div>
</div>