show recents

This commit is contained in:
Eduardo Figueroa 2026-03-04 16:17:57 -08:00
parent 2adfc5b384
commit 39cadd7479
No known key found for this signature in database
GPG key ID: E4B7BBE6F7D53330

View file

@ -0,0 +1,18 @@
{{ if .IsHome }}
{{ $posts := where site.RegularPages "Section" "docs" }}
{{ $posts = where $posts "Params.bookHidden" "ne" true }}
{{ $posts = $posts.ByDate.Reverse }}
{{ if $posts }}
<article class="markdown book-article">
<h2>Recent Posts</h2>
<ul>
{{ range first 10 $posts }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ with .Date }}<small style="opacity: 0.6; margin-left: 0.5em;">— {{ .Format "January 2, 2006" }}</small>{{ end }}
</li>
{{ end }}
</ul>
</article>
{{ end }}
{{ end }}