Pagination Config

TIP

We strongly recommend that you read the Getting Started section before using this plugin.

sorter

  • Type: function
  • Default: See Below

Sorter for matched pages, the default sorter is as follows:

function sorter(prev: VuePressPage, next: VuePressPage){
  const prevTime = new Date(prev.frontmatter.date).getTime()
  const nextTime = new Date(next.frontmatter.date).getTime()
  return prevTime - nextTime > 0 ? -1 : 1
},

The function will be a parameter of Array.sort().

lengthPerPage

  • Type: number
  • Default: 10

Maximum number of posts per page.

layout

  • Type: string
  • Default: DirectoryPagination || Layout

Layout for pagination page (Except the index page.)

getPaginationPageUrl

  • Type: function
  • Default: See Below

A function to get the url of pagination page dynamically:

function getPaginationPageUrl(index) {
  if (index === 0) {
    return indexPath
  }
  return `${indexPath}page/${index + 1}/`
}