Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acoshift/paginate
Pagination Logic for your template in Go
https://github.com/acoshift/paginate
Last synced: about 2 months ago
JSON representation
Pagination Logic for your template in Go
- Host: GitHub
- URL: https://github.com/acoshift/paginate
- Owner: acoshift
- License: mit
- Created: 2018-02-14T14:45:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-27T04:48:24.000Z (over 5 years ago)
- Last Synced: 2024-06-21T06:39:20.189Z (7 months ago)
- Language: Go
- Homepage:
- Size: 114 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# paginate
[![Build Status](https://travis-ci.org/acoshift/paginate.svg?branch=master)](https://travis-ci.org/acoshift/paginate)
[![Coverage Status](https://coveralls.io/repos/github/acoshift/paginate/badge.svg?branch=master)](https://coveralls.io/github/acoshift/paginate?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/acoshift/paginate)](https://goreportcard.com/report/github.com/acoshift/paginate)
[![GoDoc](https://godoc.org/github.com/acoshift/paginate?status.svg)](https://godoc.org/github.com/acoshift/paginate)Pagination Logic for your template
## Example
```html
{{define "pagination"}}
First
Prev
{{range .Pages 2 2}}
{{if eq . 0}}
...
{{else if eq $.Page .}}
{{.}}
{{else}}
{{.}}
{{end}}
{{end}}
Next
Last
{{end}}
```![Example](https://github.com/acoshift/paginate/raw/master/demo.gif)