{"name":"hexo-pagination","version":"2.0.0","keywords":["hexo","pagination","util"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"hexo-pagination@2.0.0","maintainers":[{"name":"ertrzyiks","email":"mateusz.derks@gmail.com"},{"name":"abnerchou","email":"hi@abnerchou.me"},{"name":"tommy351","email":"tommy351@gmail.com"},{"name":"hexobot","email":"hexojs@gmail.com"},{"name":"jlhwung","email":"i@jhuang.me"},{"name":"tomap","email":"piartt@gmail.com"},{"name":"curben","email":"bushedge@protonmail.com"},{"name":"yoshinorin","email":"nayo-msoft@outlook.jp"}],"homepage":"https://hexo.io/","bugs":{"url":"https://github.com/hexojs/hexo-pagination/issues"},"dist":{"shasum":"41283f7daab56ea29f2a4c52f9b91e0cbf8a4bdb","tarball":"http://registry-npm.ywwl.com/hexo-pagination/download/hexo-pagination-2.0.0.tgz","fileCount":4,"integrity":"sha512-ZZQli5UwFWTW6bJNF4zwp2PCeGsipgoPxadud8+cPPxvygTP5GjTS5eVWcUTcfEaCluP+O1maxZCCWmYQoJkiQ==","signatures":[{"sig":"MEQCIBAy72Umlxoq97vJ+1uzUrzvU9zbBsU0bC6M2/P57PRaAiBYYyCmuDbzdOtUjH7pxUr/r3+QcZu4yxg/OAcynG+8MA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguMxnCRA9TVsSAnZWagAAZCEP/RVmhBp6mO0GXFr0Z9iG\nIJd+aSf2bcUkbO2KoKn3/xPSiJ2WKamH8NijU+Ff0iqUHOhhP8+9VRPwTrgt\n8Sr/XrOtgHVNIuKOsVC8zvULj0QLvZ2MlyY7p2z30sjS0sIuLS7dv7eEKOX1\ndut7mePhJJGK4VeKDeV07Q8NyQlhwqLTKwSXlqSibSDhtwOe78xrjVG0at+I\nszwsHaHWsnKRbgORSNrOoatS+gLUswxbG8SkiQnB/TDIVB8RywzbHlUckcFO\nVhqlU2JHJ/kChZPVX34UNQcZYd0u+M4nsbdlgClVkdSmVbXlPOl75N/qlmUN\nf7wa9SXXIat/v3cxjpqh0b2OBF8hI6D+xqa49y1uUFTaijtkHHEQb7U8To5b\nO2Lddal9IcEaDsTJPzVT5NR2GiRNfGG0M8BvDUReZSTELocZDDCvH4b0Y1GL\nkduj08tGf0IAoDYoa/2vHy/9RLsiEg9tH4V6563V0D1L6nct9lnV6tfk8CA0\nM1i1GLoAzoZsNk94vB9a5MzowqJ9D+2pvcHDr9ucJcbImmJsCb/NTmf/0I0m\nTF/bNJ5t4rfMqZQeuFKlN+F8PerDI6YKNcTpyd0PP8qDsJci9bxNxAdD0muz\nYtE7wLHKFcHOSH0D9xlAIsfEu4pfisiMAUhNyhCGeIl4B6VvklXYLxTN+zDL\n775a\r\n=MWrj\r\n-----END PGP SIGNATURE-----\r\n","size":2432,"noattachment":false,"key":"/hexo-pagination/-/hexo-pagination-2.0.0.tgz"},"main":"lib/pagination","engines":{"node":">=10.13.0"},"gitHead":"87ed40beedcd37337b7393aa0c7984e1f9da946d","scripts":{"test":"mocha test/index.js","eslint":"eslint .","test-cov":"nyc npm run test"},"_npmUser":{"name":"yoshinorin","email":"nayo-msoft@outlook.jp"},"repository":{"url":"git+https://github.com/hexojs/hexo-pagination.git","type":"git"},"_npmVersion":"6.14.11","description":"Pagination utilities for Hexo generator plugins.","directories":{"lib":"./lib"},"_nodeVersion":"16.1.0","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.0","chai":"^4.1.2","mocha":"^8.1.1","eslint":"^7.1.0","eslint-config-hexo":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/hexo-pagination_2.0.0_1622723687485_0.8347100394916904","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":1622723687635,"_cnpm_publish_time":1622723687635,"dist-tags":{"latest":"4.0.0","next":"1.0.0-rc1"}}