{"name":"hexo-pagination","version":"3.0.0","keywords":["hexo","pagination","util"],"author":{"url":"http://zespia.tw","name":"Tommy Chen","email":"tommy351@gmail.com"},"license":"MIT","_id":"hexo-pagination@3.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":"yoshinorin.net@outlook.com"}],"homepage":"https://hexo.io/","bugs":{"url":"https://github.com/hexojs/hexo-pagination/issues"},"dist":{"shasum":"b98b050bbddff25ae646e3d00ad607ac6ae77ea7","tarball":"http://registry-npm.ywwl.com/hexo-pagination/download/hexo-pagination-3.0.0.tgz","fileCount":4,"integrity":"sha512-8oo1iozloZo7TojPVYg4IxL3SJKCBdSJ908fTlIxIK7TWJIKdYnQlW31+12DBJ0NhVZA/lZisPObGF08wT8fKw==","signatures":[{"sig":"MEUCIQCBeUMOqH8f3iW3jvOtfPtlALk7hjDNe+FXE67ItIkoewIgLuhZkikUWd+NUpqHJQVebryEBFKXpGq1oClDr0Y8mT4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRqr6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmph2hAAmHQrwsmBxGqHKtmV2qGS+SMJT57uajNQMlzLQmU1j6bt57Ts\r\nHWEetFfkIJjs/iFq6nyUJdNXC1+kTDdFdrvk48nnDDRSrZQx3q3vigltBOP5\r\nACp5jeUdT8ZqAGzucyRIP48u/wPtN2giY2a4i1p/FqNcR9TlFXITGbPW9Ito\r\nce+mUfmB83tbJ34crPl5B/Ho5uZR5ppcUXfnFOmbXSCK6oxWkhFUJjGupC/s\r\nafHDXimVxeKacslQLd9IZ/yWMOe30f3+J6AI1np+QbEz5/rFYAvz/2xjLYys\r\nbzpmRlFoPwS5eHHZxyzbf2L8s2pE2glzTqGD0kSLJJ2h/Igi2C8Ny8g0xftx\r\n06a6paG3PTari6XRCFiWppnN76nd6UdEj+9OThTCSNKDCiwscpvgBdb9uH9l\r\negFv/OYIJXR8sTkgQ3BbqQmV9iGHJgh4Hk1UVN+QtttS5AXTtp3ltz4T+0wd\r\n1b52zO7urnR9td8YwU3c0+7rrufBe09HRvlkFgz2mnkfqCBq5FqB0qOzrrzk\r\nvJF0XDR2Xb/NnekJ/Ap1kM2AqTAZkSEOJPoxZeknumsoD6TNLn0DUNkV64/n\r\nkrqwmtTKJyh09CyJErNXGMuY5+572Krk08E+bFInZCFQfDT96IEXiW5BSa5L\r\njlcuQT/VMRKv/Fml5zI4U2QMV5M5VM6MjuQ=\r\n=7csX\r\n-----END PGP SIGNATURE-----\r\n","size":2450,"noattachment":false,"key":"/hexo-pagination/-/hexo-pagination-3.0.0.tgz"},"main":"lib/pagination","engines":{"node":">=14"},"gitHead":"9b10ed0e9f55cb5cf32362ba3523763e573b6a51","scripts":{"test":"mocha test/index.js","eslint":"eslint .","test-cov":"c8 --reporter=lcovonly npm run test"},"_npmUser":{"name":"yoshinorin","email":"yoshinorin.net@outlook.com"},"repository":{"url":"git+https://github.com/hexojs/hexo-pagination.git","type":"git"},"_npmVersion":"8.4.0","description":"Pagination utilities for Hexo generator plugins.","directories":{"lib":"./lib"},"_nodeVersion":"16.16.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^7.12.0","chai":"^4.3.6","mocha":"^10.0.0","eslint":"^8.24.0","eslint-config-hexo":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hexo-pagination_3.0.0_1665575674235_0.7476815304884434","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":1665575674422,"_cnpm_publish_time":1665575674422,"dist-tags":{"latest":"4.0.0","next":"1.0.0-rc1"}}