From 26e0a9a25916cea4292c478864348e5f3cd40bc5 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 26 May 2019 10:28:31 +0300 Subject: [PATCH] layouts/partials/recent.html: Only list "Regular" pages This makes Hugo only list "Regular" pages in the sidebar. Otherwise if you have very few posts, for example, you might see one entry in the list called "Posts". See: https://gohugo.io/functions/where/#mainsections --- layouts/partials/recent.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/recent.html b/layouts/partials/recent.html index 5cc7f67..c9fdf20 100644 --- a/layouts/partials/recent.html +++ b/layouts/partials/recent.html @@ -2,7 +2,7 @@

{{ i18n "recentPosts" }}

    {{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }} -{{ range first $num_recent_posts (where .Site.Pages "Section" "in" .Site.Params.mainSections) }} +{{ range first $num_recent_posts (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
  1. {{.Title | markdownify }}
  2. {{ end }}