diff options
author | Paul Duncan <pabs@pablotron.org> | 2021-10-26 18:23:29 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2021-10-26 18:23:29 -0400 |
commit | 1a31f66aecdc5aedd96bc2a5474fc2589602e3c2 (patch) | |
tree | 48f8a2a1ec38854e148573f21b68a36248c8f099 /themes/hugo-pt2021/layouts/_default | |
parent | e78863d6b4c4867581dbf99bc85b074e78db8e0a (diff) | |
download | pablotron.org-1a31f66aecdc5aedd96bc2a5474fc2589602e3c2.tar.bz2 pablotron.org-1a31f66aecdc5aedd96bc2a5474fc2589602e3c2.zip |
themes/hugo-pt2021/layouts/_default/index.xml: limit to 15 posts
Diffstat (limited to 'themes/hugo-pt2021/layouts/_default')
-rw-r--r-- | themes/hugo-pt2021/layouts/_default/index.xml | 6 |
1 files changed, 4 insertions, 2 deletions
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 -}} |