Simplify posts list

This commit is contained in:
Dave Gallant
2024-03-31 12:35:51 -04:00
parent 37a27723f9
commit 5d87003de0
3 changed files with 4 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
---
title: "davegallant.ca — Blog"
title: Blog
---
[RSS Feed](https://davegallant.ca/index.xml)
Subscribe via [RSS](https://davegallant.ca/index.xml).

View File

@@ -1,24 +1,12 @@
{{ range $pageIndex, $page := .Pages }}
<article class="post">
<div class="post-header">
<h2>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</h2>
{{ partial "post-meta.html" (dict "page" . "pageIndex" $pageIndex) }}
</div>
<div class="post-content">
{{ with .Description }}
{{ . }}
{{ else }}
{{ .Summary }}
{{ if .Truncated }}
<div class="post-content__read-more">
<a href="{{ .RelPermalink }}">Read more &gt;</a>
</div>
{{ end }}
{{ end }}
</div>
</article>
{{ end }}

View File

@@ -2,26 +2,4 @@
{{- with .page.Date -}}
<span>{{ .Format "2006-01-02" }}</span>
{{- end -}}
{{- with .page.Params.Author -}}
<span> by </span><span class="post-meta__author">{{ . }}</span>
{{- end -}}
{{ with .page.Params.tags }}
<div class="post-tags">
{{ range . -}}
<a class="post-tag" href="{{ urlize (printf "tags/%s" . ) | absURL }}">
{{- /* Replace hyphen with non-breaking hyphen */ -}}
{{- replace (urlize .) "-" "&#8209;" | safeHTML -}}
</a>
{{- end }}
</div>
{{ end }}
{{ if .page.Params.cover }}
<!--
Only lazy-load images below-the-fold. For post lists, start loading
covers from the third post and onwards.
-->
{{ $lazy := ge .pageIndex 2 }}
{{ partial "image.html" (dict "src" .page.Params.cover.src "alt" .page.Params.cover.alt "caption" .page.Params.cover.caption "page" .page "lazy" $lazy) }}
{{ end }}
</div>