Skip to content

Commit

Permalink
fix: pages number in the pagination plugin (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsotirov authored and ulivz committed Oct 29, 2018
1 parent 6e5bc66 commit 8bdeb09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@vuepress/plugin-pagination/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { path } = require('@vuepress/shared-utils')

function getIntervallers (max, interval) {
const count = Math.floor(max / interval)
const arr = [...Array(count + 1)]
const count = max % interval === 0 ? Math.floor(max / interval) : Math.floor(max / interval) + 1
const arr = [...Array(count)]
return arr.map((v, index) => {
const start = index * interval
const end = (index + 1) * interval - 1
Expand Down

0 comments on commit 8bdeb09

Please sign in to comment.