From 1a31f66aecdc5aedd96bc2a5474fc2589602e3c2 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 26 Oct 2021 18:23:29 -0400 Subject: themes/hugo-pt2021/layouts/_default/index.xml: limit to 15 posts --- themes/hugo-pt2021/layouts/_default/index.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'themes') diff --git a/themes/hugo-pt2021/layouts/_default/index.xml b/themes/hugo-pt2021/layouts/_default/index.xml index aaa9fdb..ade0515 100644 --- a/themes/hugo-pt2021/layouts/_default/index.xml +++ b/themes/hugo-pt2021/layouts/_default/index.xml @@ -7,16 +7,18 @@ URL: Changes: * changed ".Summary | html" to ".Content | htmlEscape" * changed "Recent content on" to "Recent posts on" +* add default limit of 15 (hard-coded for now because $limit appears to + be busted */}} {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- $pages := slice -}} {{- if or $.IsHome $.IsSection -}} - {{- $pages = where $pctx.RegularPages "Section" "posts" -}} + {{- $pages = where $pctx.RegularPages "Section" "posts" | first 15 -}} {{- else -}} {{- $pages = $pctx.Pages -}} {{- end -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- $limit := default 15 .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} -- cgit v1.2.3