{{ define "main" }}
{{ .Content }}
{{/* For Hugo 0.20 this will default to the section with the most number of pages. */}}
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{/* Create a variable to use the same section twice. */}}
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
{{ if $section }}
Recent Articles
{{ range (first 3 $section) }}
{{ partial "summary-with-image.html" . }}
{{ end }}
More Posts
{{/* Nest the requirements, "after" then "first" on the outside */}}
{{ range (first 4 (after 3 $section)) }}