{{ define "main" }}
{{ .Content }}
{{/* Create a variable to use the same section twice. Note that we've included the date here. */}} {{ $section := where .Data.Pages.ByDate.Reverse "Section" "post" }} {{ if $section }}

Recent Articles

{{ range (first 3 $section) }}
{{ .Render "summary-with-image" }}
{{ end }}

More Posts

{{/* Nest the requirements, "after" then "first" on the outside */}} {{ range (first 4 (after 1 $section)) }}

{{ .Title }}

{{ end }} All Posts
{{ end }} {{ end }}