From f7b4f0a819b87a138387052380d70181368ea350 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sat, 3 Sep 2016 20:21:40 +0300 Subject: [PATCH] Allow configuration of how many posts to show on the homepage You can set this property in your site's config to override: [params] num_recent_posts = 7 Defaults to five (5) if unset. --- layouts/_default/list.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2039ed6..951326c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,8 @@ {{ define "main" }} - {{ range .Data.Pages }} + {{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }} + + {{ range first $num_recent_posts .Data.Pages }} {{ .Render "summary"}} {{ end }}