{{ $relatedMax := .Site.Params.relatedMax | default 5 }} {{ $related := .Site.RegularPages.Related . | first $relatedMax }} {{ if and ($related) (.Param "related") }}