云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
hexo
/
hexo-blog
/
node_modules
/
hexo-pagination
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
lib
2024-01-09 18:36:00
1.58 KB
LICENSE
2023-11-13 01:33:42
1.03 KB
package.json
2023-11-13 01:33:43
775 B
README.md
2023-11-13 01:33:43
1.5 KB
# hexo-pagination [](https://github.com/hexojs/hexo-pagination/actions?query=workflow%3ATester) [](https://www.npmjs.com/package/hexo-pagination) [](https://coveralls.io/r/hexojs/hexo-pagination?branch=master) Pagination utilities for [Hexo] generator plugins. ## Installation ``` bash $ npm install hexo-pagination --save ``` ## Usage ### pagination(base, posts, [options]) Option | Description | Default --- | --- | --- `perPage` | Posts displayed per page | 10 `format` | URL format | page/%d/ `layout` | Layout. This value can be a string or an array. | ['archive', 'index'] `data` | Extra data | For example: ``` js var pagination = require('hexo-pagination'); pagination('/tags/hexo', [], { perPage: 10, format: 'page/%d/', layout: ['archive', 'index'], data: { tag: 'hexo' } }); ``` This function returns an array containing objects with 3 properties: `path`, `layout`, `data`. Data | Description --- | --- `base` | Base URL `total` | Total pages `current` | Current page number `current_url` | Path of the current page (which equals to `path`) `posts` | The slice of posts for the current page `prev` | Previous page number `prev_link` | The path to the previous page `next` | Next page number `next_link` | The path to the next page ## License MIT [Hexo]: https://hexo.io/
2025-08-29 16:31:17 Friday 216.73.216.167 Runningtime:0.011s Mem:1.47 MB