🐛 Recent articles should always display 5 links

pull/368/head
James Panther 2022-11-14 13:24:57 +11:00
parent 7970511402
commit eb573dc1b9
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- List page doesn't render nested list pages ([#365](https://github.com/jpanther/congo/issues/365)) - List page doesn't render nested list pages ([#365](https://github.com/jpanther/congo/issues/365))
- Pagination is duplicated on term pages ([#366](https://github.com/jpanther/congo/issues/366)) - Pagination is duplicated on term pages ([#366](https://github.com/jpanther/congo/issues/366))
- Link to last pagination page sometimes displays twice - Link to last pagination page sometimes displays twice
- Recent articles would sometimes display less than five articles
## [2.4.0] - 2022-11-10 ## [2.4.0] - 2022-11-10

View File

@ -1,6 +1,6 @@
{{ if .Site.Params.homepage.showRecent | default false }} {{ if .Site.Params.homepage.showRecent | default false }}
<h2 class="mt-8 text-2xl font-extrabold">{{ i18n "shortcode.recent_articles" | emojify }}</h2> <h2 class="mt-8 text-2xl font-extrabold">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
{{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages }} {{ range first 5 (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) 5).Pages }}
{{ partial "article-link.html" . }} {{ partial "article-link.html" . }}
{{ end }} {{ end }}
{{ end }} {{ end }}