added thumbnail to posts page

This commit is contained in:
Ben Varick 2025-10-30 15:10:14 -07:00
parent 0e8bc3652b
commit efde3369bc
Signed by: ben
SSH key fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
14 changed files with 120 additions and 33 deletions

View file

@ -0,0 +1,29 @@
{{ range .Pages.ByPublishDate.Reverse }}
{{ $post := . }}
<div class="post-item" style="display: flex; align-items: center; margin-bottom: 2rem; gap: 1.5rem;">
{{ with .Params.image }}
{{ with $post.Resources.GetMatch . }}
{{ with .Resize "400x" }}
<div style="flex-shrink: 0;">
<a href="{{ $post.Permalink }}">
<img src="{{ .Permalink }}" alt="{{ $post.Title }}" style="max-width: 300px; height: auto; border-radius: 4px;">
</a>
</div>
{{ end }}
{{ end }}
{{ end }}
<div style="flex-grow: 1;">
<h3 class="title is-4" style="margin-bottom: 0.5rem;">
<a href="{{ $post.Permalink }}">{{ $post.Title | markdownify }}</a>
</h3>
{{ if $post.Params.date }}
<p class="has-text-grey" style="margin-bottom: 0.5rem;">
{{ $post.Date.Format (.Site.Params.dateFormat | default ":date_medium") }}
</p>
{{ end }}
{{ if $post.Summary }}
<p>{{ $post.Summary | truncate 150 }}</p>
{{ end }}
</div>
</div>
{{ end }}