Socket
Socket
Sign inDemoInstall

hexo-pagination

Package Overview
Dependencies
0
Maintainers
8
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-pagination

Pagination utilities for Hexo generator plugins.


Version published
Maintainers
8
Weekly downloads
14,123
increased by0.3%

Weekly downloads

Readme

Source

hexo-pagination

Build Status NPM version Coverage Status

Pagination utilities for Hexo generator plugins.

Installation

$ npm install hexo-pagination --save

Usage

pagination(base, posts, [options])

OptionDescriptionDefault
perPagePosts displayed per page10
formatURL formatpage/%d/
layoutLayout. This value can be a string or an array.['archive', 'index']
dataExtra data

For example:

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.

DataDescription
baseBase URL
totalTotal pages
currentCurrent page number
current_urlPath of the current page (which equals to path)
postsThe slice of posts for the current page
prevPrevious page number
prev_linkThe path to the previous page
nextNext page number
next_linkThe path to the next page

License

MIT

Keywords

FAQs

Last updated on 12 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc