{{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }} <h3>Similar articles:</h3> <ul> {{ range . }} <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{ end }} </ul> {{ end }}