{"id":28502376,"url":"https://github.com/hexojs/hexo-pagination","last_synced_at":"2025-10-06T11:03:58.114Z","repository":{"id":25078215,"uuid":"28498681","full_name":"hexojs/hexo-pagination","owner":"hexojs","description":"Pagination utilities for Hexo generator plugins.","archived":false,"fork":false,"pushed_at":"2024-10-04T22:53:57.000Z","size":299,"stargazers_count":23,"open_issues_count":5,"forks_count":10,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-08T16:09:47.699Z","etag":null,"topics":["hexo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexojs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-26T03:45:54.000Z","updated_at":"2025-06-05T16:08:42.000Z","dependencies_parsed_at":"2024-01-23T21:30:40.051Z","dependency_job_id":"cca64218-fc17-4976-86ef-ff5c359e2e90","html_url":"https://github.com/hexojs/hexo-pagination","commit_stats":{"total_commits":65,"total_committers":11,"mean_commits":5.909090909090909,"dds":0.6615384615384615,"last_synced_commit":"0804e679f9bc7672bfa2decd8f77f92ed5c95de8"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hexojs/hexo-pagination","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexojs","download_url":"https://codeload.github.com/hexojs/hexo-pagination/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexojs%2Fhexo-pagination/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261417590,"owners_count":23155074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hexo"],"created_at":"2025-06-08T16:09:52.631Z","updated_at":"2025-10-06T11:03:53.096Z","avatar_url":"https://github.com/hexojs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexojs%2Fhexo-pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexojs%2Fhexo-pagination/lists"}