mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2025-05-08 13:36:01 +02:00
layouts/_default/list.html: Use paginator for page lists instead of custom stuff
Hugo's own pagination stuff works just as well and probably covers even more corner cases. Also, this is one less config variable to have to check because you can just use Paginate (Default: 10).
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }}
|
||||
|
||||
{{ range first $num_recent_posts (where .Data.Pages "Type" "post") }}
|
||||
{{ .Render "summary"}}
|
||||
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user