hexo.extend.helper.register("uk_paginator", function(option) { const options = Object.assign({ base: "/", pagePath: "page/%d/", total: 1, current: 1, space: "...", sideSize: 5, midSize: 10, mainClasses: [], itemClasses: [], }, option); const pagePathReplaced = options.pagePath.replace('/', '\/').replace('%d', '\\d+'); const regPagePath = new RegExp(pagePathReplaced); options.base = options.base.replace(regPagePath, ''); let pageStructure = []; pageStructure.push(``); return pageStructure.join("\n"); });