Socket
Socket
Sign inDemoInstall

hexo-pagination

Package Overview
Dependencies
1
Maintainers
1
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
1
Install size
12.5 kB
Created

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.

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

Keywords

FAQs

Last updated on 13 Jun 2016

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