{{ define "main" }}
{{ .Content }}
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}} {{ $mainSections := site.Params.mainSections | default (slice "post") }} {{ $show_recent_posts := site.Params.ananke.show_recent_posts }} {{ $section := where $.Site.RegularPages "Section" "in" $mainSections }} {{ $section_count := len $section }} {{ if and ($show_recent_posts) (ge $section_count 1) }}
{{ $n_posts := $.Param "recent_posts_number" | default 3 }}
{{/* Range through the first $n_posts items of the section */}} {{ range (first $n_posts $section) }}
{{ .Render "summary-with-image" }}
{{ end }}
{{ if ge $section_count (add $n_posts 1) }}

{{ i18n "more" }}

{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}} {{ range (first 4 (after $n_posts $section)) }}

{{ .Title }}

{{ end }}
{{ end }}
{{ end }} {{ end }}