Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)