fix:修正分页辅助函数在深层次目录中的工作。

This commit is contained in:
徐涛 2021-05-17 15:47:06 +08:00
parent 332c38a97a
commit f6edefaa2c

View File

@ -10,6 +10,12 @@ hexo.extend.helper.register("uk_paginator", function(option) {
mainClasses: [],
itemClasses: [],
}, option);
const pagePathReplaced = options.pagePath.replace('/', '\/').replace('%d', '\\d+');
console.log(pagePathReplaced);
const regPagePath = new RegExp(pagePathReplaced);
console.log(regPagePath);
options.base = options.base.replace(regPagePath, '');
console.dir(options);
let pageStructure = [];
pageStructure.push(`<ul class="uk-pagination ${options.mainClasses.join(' ')}">`);