limit related pages to /posts (do not include other pages like /spam)

This commit is contained in:
Dominic Reich 2025-01-11 09:09:25 +01:00
parent 28222b530f
commit 590d50cfb5
Signed by: dominic
GPG key ID: 0B5787DB23049C45

View file

@ -1,11 +1,17 @@
{{ $opts := dict
"document" .
"indices" (slice "tags")
}}
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }} {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}
<h3>Related Posts</h3> <h3>Related Posts</h3>
<ul> <ul>
{{ range . }} {{ range . }}
{{ if and (eq .Section "posts") .IsPage }}
<li> <li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a> // <strong>{{ .Date | time.Format "2006" }}</strong>, {{ .Date | time.Format "January 2" }}<br /> <a href="{{ .RelPermalink }}">{{ .Title }}</a> // <strong>{{ .Date | time.Format "2006" }}</strong>, {{ .Date | time.Format "January 2" }}<br />
<small>{{ .Summary }}</small> <small>{{ .Summary | emojify }}</small>
</li> </li>
{{ end }} {{ end }}
{{ end }}
</ul> </ul>
{{ end }} {{ end }}