# ghost-need-pagination

> Custom handlebars helper to show ghost pagination if only it's needed

Latest version **0.1.3** (published 2016-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ghost-need-pagination
pnpm add ghost-need-pagination
yarn add ghost-need-pagination
bun add ghost-need-pagination
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2016-12-16 |
| First published | 2016-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Quteron |
| Maintainers | quteron |
| Keywords | ghost, pagination, handlebars, handlebars helpers |

## Links

- npm: https://www.npmjs.com/package/ghost-need-pagination
- Repository: https://github.com/quteron/ghost-need-pagination
- Homepage: https://github.com/quteron/ghost-need-pagination#readme
- Issues: https://github.com/quteron/ghost-need-pagination/issues
- npm.io page: https://npm.io/package/ghost-need-pagination

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2016-12-16
- 0.1.1 — 2016-07-17
- 0.1.0 — 2016-07-17
- 0.0.1 — 2016-07-17

## README

[![Build Status](https://travis-ci.org/quteron/ghost-need-pagination.svg?branch=master)](https://travis-ci.org/quteron/ghost-need-pagination)  [![Coverage Status](https://coveralls.io/repos/github/quteron/ghost-need-pagination/badge.svg?branch=master)](https://coveralls.io/github/quteron/ghost-need-pagination?branch=master)

Ghost-Need-Pagination
=========

Custom handlebars helper to display pagination if only it's needed, in other words, if only it's more than one page.

## Installation

 `npm install ghost-need-pagination`

## Example

Register custom helper in the `config.js` ghost file:

```javascript
  var need_pagination = require('ghost-need-pagination');
  var hbs = require('express-hbs');
  hbs.registerHelper('need-pagination', need_pagination);
```

Update ghost template `partials/pagination.hbs`:

```html
{{#need_pagination pages}}
    <nav class="pagination" role="navigation">
        {{#if prev}}
            <a href="{{page_url prev}}">
                <i class="fa fa-chevron-left" aria-hidden="true"></i>
            </a>
        {{/if}}
        {{#if next}}
            <a href="{{page_url next}}">
                <i class="fa fa-chevron-right" aria-hidden="true"></i>
            </a>
        {{/if}}
    </nav>
{{/need_pagination}}
```

To remove undesired whitespaces, look at [Whitespace Control](http://handlebarsjs.com/expressions.html#whitespace-control) section on the [official handlebars site](http://handlebarsjs.com/).

## Tests

  `npm test`

## License

MIT License

---
_Source: https://npm.io/package/ghost-need-pagination · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
