hugo-toha/layouts/partials/sections/recent-posts.html
donfiguerres 6d98c15136
Configure the number of posts in recent posts (#395)
* Add configuration to number of recent posts.

* Added default value.

Co-authored-by: donfiguerres <donfiguerres@github.com>
2021-08-14 10:00:35 +00:00

23 lines
660 B
HTML

{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
{{ $numShow := 3}}
{{ if .section.numShow }}
{{ $numShow = .section.numShow }}
{{ end }}
<div class="container-fluid anchor pb-5 recent-posts-section" id="{{ $sectionID }}">
{{ if not (.section.hideTitle) }}
<h1 class="text-center">{{ .section.name }}</h1>
{{ end }}
<div class="container">
<div class="row" id="recent-post-cards">
{{ range first $numShow (where site.RegularPages.ByDate.Reverse "Type" "in" "posts" )}}
{{ partial "cards/recent-post.html" . }}
{{ end }}
</div>
</div>
</div>