diff --git a/layouts/blog/list.html b/layouts/blog/list.html index ead1989..41b704a 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -64,7 +64,7 @@
- {{partial "articles.html" (dict "Paging" true "context" . "ammount" 9) 5}} + {{partial "articles.html" (dict "Paging" true "context" . "ammount" 9 "pagination" true) 5}}
diff --git a/layouts/partials/articles.html b/layouts/partials/articles.html index 6c90b84..24868af 100644 --- a/layouts/partials/articles.html +++ b/layouts/partials/articles.html @@ -9,10 +9,6 @@ {{ if .ammount }} {{ $ammount = (cast.ToInt .ammount) }} {{ end }} - {{ if (.Get 2) }} - {{ debug.Dump (.Get 2) }} - {{ $ammount = (cast.ToInt (.Get 2) )}} - {{ end }} {{ if (eq (len $allposts) 0) }}
- {{ range $index, $article := ($context.Page.Paginate $allposts (cast.ToInt $ammount)).Pages }} + {{ $pageslist := (first $ammount $allposts )}} + {{ if .pagination }} + {{ $pageslist = ($context.Page.Paginate $allposts (cast.ToInt $ammount)).Pages }} + {{ end }} + {{ range $index, $article := $pageslist }}