{"name":"hexo-pagination","version":"0.1.0","keywords":["hexo","pagination","util"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"hexo-pagination@0.1.0","maintainers":[{"name":"tommy351","email":"tommy351@gmail.com"}],"homepage":"http://hexo.io/","bugs":{"url":"https://github.com/hexojs/hexo-pagination/issues"},"dist":{"shasum":"54f0be12e6ae51d1c0a6f0023674ba77ac514ce3","tarball":"http://registry-npm.ywwl.com/hexo-pagination/download/hexo-pagination-0.1.0.tgz","integrity":"sha512-Ji/LYq7xP7cdBdG15CJ4YZZNA/c6Kf64rXj+Jp2bKsC2JTgcBmz+GGkHwpk6aoMHXRP2XraxGcGjXhITr7ooYg==","signatures":[{"sig":"MEQCIFiWhQU0guQxyPFWqXzxE+m9cWMiv98ecWqJ53VR4QJxAiAKD72IMhSdafb205jnh8eGp/aM4vzsyZQo5adeezl1Eg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":2781,"noattachment":false,"key":"/hexo-pagination/-/hexo-pagination-0.1.0.tgz"},"main":"lib/pagination","_from":".","_shasum":"54f0be12e6ae51d1c0a6f0023674ba77ac514ce3","gitHead":"c4fc916be3978392cfbede61c3b8322cc9b17525","scripts":{"jscs":"jscs .","test":"mocha test/index.js","eslint":"eslint .","test-cov":"istanbul cover --print both _mocha -- test/index.js"},"_npmUser":{"name":"tommy351","email":"tommy351@gmail.com"},"repository":{"url":"git+https://github.com/hexojs/hexo-pagination.git","type":"git"},"_npmVersion":"3.7.1","description":"Pagination utilities for Hexo generator plugins.","directories":{"lib":"./lib"},"_nodeVersion":"4.3.0","dependencies":{"object-assign":"^4.1.0"},"devDependencies":{"chai":"^3.5.0","jscs":"^3.0.4","mocha":"^2.5.3","eslint":"^2.12.0","istanbul":"^0.4.3","jscs-preset-hexo":"^1.0.1","eslint-config-hexo":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/hexo-pagination-0.1.0.tgz_1465821096810_0.2622474799863994","host":"packages-12-west.internal.npmjs.com"},"readme":"# hexo-pagination\n\n[![Build Status](https://github.com/hexojs/hexo-pagination/workflows/Tester/badge.svg)](https://github.com/hexojs/hexo-pagination/actions?query=workflow%3ATester)\n[![NPM version](https://badge.fury.io/js/hexo-pagination.svg)](https://www.npmjs.com/package/hexo-pagination)\n[![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-pagination.svg)](https://coveralls.io/r/hexojs/hexo-pagination?branch=master)\n\nPagination utilities for [Hexo] generator plugins.\n\n## Installation\n\n```bash\n$ npm install hexo-pagination --save\n```\n\n## Usage\n\n### pagination(base, posts, [options])\n\n| Option           | Description                                     | Default                |\n| ---------------- | ----------------------------------------------- | ---------------------- |\n| `perPage`        | Posts displayed per page                        | `10`                   |\n| `format`         | URL format                                      | `page/%d/`             |\n| `layout`         | Layout. This value can be a string or an array. | `['archive', 'index']` |\n| `data`           | Extra data                                      | `{}`                   |\n| `explicitPaging` | Number the first page. e.g. `page/1/index.html` | `false`                |\n\nFor example:\n\n```js\nvar pagination = require(\"hexo-pagination\");\n\npagination(\"/tags/hexo\", [], {\n  perPage: 10,\n  format: \"page/%d/\",\n  layout: [\"archive\", \"index\"],\n  data: {\n    tag: \"hexo\",\n  },\n});\n```\n\nThis function returns an array containing objects with 3 properties: `path`, `layout`, `data`.\n\n| Data          | Description                                       |\n| ------------- | ------------------------------------------------- |\n| `base`        | Base URL                                          |\n| `total`       | Total pages                                       |\n| `current`     | Current page number                               |\n| `current_url` | Path of the current page (which equals to `path`) |\n| `posts`       | The slice of posts for the current page           |\n| `prev`        | Previous page number                              |\n| `prev_link`   | The path to the previous page                     |\n| `next`        | Next page number                                  |\n| `next_link`   | The path to the next page                         |\n\n## License\n\nMIT\n\n[Hexo]: https://hexo.io/\n","publish_time":1465821097480,"_cnpm_publish_time":1465821097480,"dist-tags":{"latest":"4.0.0","next":"1.0.0-rc1"}}