1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-24 21:20:17 +01:00

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.
This commit is contained in:
Alan Orth 2016-09-03 20:21:40 +03:00
parent a942707278
commit f7b4f0a819
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -1,6 +1,8 @@
{{ define "main" }} {{ define "main" }}
{{ range .Data.Pages }} {{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }}
{{ range first $num_recent_posts .Data.Pages }}
{{ .Render "summary"}} {{ .Render "summary"}}
{{ end }} {{ end }}