{"name":"hexo-pagination","version":"1.0.0","keywords":["hexo","pagination","util"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"hexo-pagination@1.0.0","maintainers":[{"name":"abnerchou","email":"hi@abnerchou.me"},{"name":"curben","email":"bushedge@protonmail.com"},{"name":"ertrzyiks","email":"mateusz.derks@gmail.com"},{"name":"hexobot","email":"hexojs@gmail.com"},{"name":"jlhwung","email":"i@jhuang.me"},{"name":"tomap","email":"piartt@gmail.com"},{"name":"tommy351","email":"tommy351@gmail.com"},{"name":"yoshinorin","email":"nayo-msoft@outlook.jp"}],"homepage":"http://hexo.io/","bugs":{"url":"https://github.com/hexojs/hexo-pagination/issues"},"dist":{"shasum":"c9c0ca3665267b9e9d0a89fc3edcaf3276907dc1","tarball":"http://registry-npm.ywwl.com/hexo-pagination/download/hexo-pagination-1.0.0.tgz","fileCount":4,"integrity":"sha512-miEVFgxchPr2qNWxw0JWpJ9R/Yaf7HjHBZVjvCCcqfbsLyYtCvIfJDxcEwz1sDOC/fLzYPqNnhUI73uNxBHRSA==","signatures":[{"sig":"MEYCIQCdWzHBlp6LU2bAenjmPBWMFIvkcPoBOQ6nwaLn8LU1/QIhAK95fAY+DuV56uTQ3aa/BweSUH75hh9tLiWYxurYQB1L","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZAJLCRA9TVsSAnZWagAAH/4P/jL0fRh+5m7c+zCZzGKS\n3LjbZodfq7Xw7GBsVFiT+tiFSt72yNAKzYVFzVpMQdyuBm2TummyBsAjd4L3\nblXYS9R/G+1zTk1HWn54uTpI6arRjJBm8g53151snuGvXpNxX4Y6Uv7d1ZoK\nytMoAwXrv5TvCeUppDEXwqho1lidzwLcCfYjStn5lWO6GK7S/U5IWuCe7V9F\nWEtZcNAkWnsDhadeoMvnZURZ+dS558PUVHDMbqX7VIZjY0c6A3Xhr0HrkM79\nGlERzvxgSefHf4WX3/9T5G9iei9PtbGVGm5fQIzt5NuXyKz/5iYXJkCjAKFK\nCnzjXWrF7yemhYTnoKeEvE7JvD7enxDX60CSzh4kH6DSohK/xWQGLhIPyQ0c\n2EoPOKla6J4D2m8N2TP8qwCifWFdOEFjqPvq9RImFCdOTKxmoxXqgPVVWTsh\nDnOR3fDVzLhH+rTWw77BDwll+lW6KKVYIBrIoHpGYmided4pQrGFDlabHf0i\nU74womPw1DxiFHDKP3CEdhglUx8dAzVT0slp2GoM8TTEA26uXUG+m+FZQ9pf\nv2li7ihIUuWdofHjhm9DGD9lvRc44bUSf+GkUGBMrfYpKwRFcLz18jG6H1Zi\n3Q6LeQjAfZqhdJc6SR0nCPJbnj3lyh8BynvgTKHQH0U+oh7J8rPy/3dxYNUD\nj0Pz\r\n=Zsgq\r\n-----END PGP SIGNATURE-----\r\n","size":2453,"noattachment":false,"key":"/hexo-pagination/-/hexo-pagination-1.0.0.tgz"},"main":"lib/pagination","engines":{"node":">=8.6.0"},"gitHead":"3f763d59eb410dcc055eac542edc2e0a6c5dd886","scripts":{"test":"mocha test/index.js","eslint":"eslint .","test-cov":"nyc npm run test"},"_npmUser":{"name":"tomap","email":"piartt@gmail.com"},"repository":{"url":"git+https://github.com/hexojs/hexo-pagination.git","type":"git"},"_npmVersion":"6.9.0","description":"Pagination utilities for Hexo generator plugins.","directories":{"lib":"./lib"},"_nodeVersion":"12.8.1","_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.1.1","chai":"^4.1.2","mocha":"^6.0.2","eslint":"^6.0.1","eslint-config-hexo":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hexo-pagination_1.0.0_1566835274856_0.5588999149012206","host":"s3://npm-registry-packages"},"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":1566835274981,"_cnpm_publish_time":1566835274981,"dist-tags":{"latest":"4.0.0","next":"1.0.0-rc1"}}