mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Merge commit '8b9803425e63e1b1801f8d5d676e96368d706722'
This commit is contained in:
25
docs/content/en/methods/pager/TotalNumberOfElements.md
Normal file
25
docs/content/en/methods/pager/TotalNumberOfElements.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: TotalNumberOfElements
|
||||
description: Returns the number of pages in the pager collection.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/pager/NumberOfElements
|
||||
- methods/page/Paginate
|
||||
returnType: int
|
||||
signatures: [PAGER.TotalNumberOfElements]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ $pages := where site.RegularPages "Type" "posts" }}
|
||||
{{ $paginator := .Paginate $pages }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
|
||||
{{ with $paginator }}
|
||||
{{ .TotalNumberOfElements }}
|
||||
{{ end }}
|
||||
```
|
Reference in New Issue
Block a user