mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 09:02:18 +01: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:
parent
98a8c2b234
commit
70b4844c63
@ -1,9 +1,8 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
{{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }}
|
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
|
||||||
|
{{ range $paginator.Pages }}
|
||||||
{{ range first $num_recent_posts (where .Data.Pages "Type" "post") }}
|
{{ .Render "summary" }}
|
||||||
{{ .Render "summary"}}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user