fix: buildBreadcrumbs naively prepending relative path even if absolute paths are passed in

isekai-main
Julian Lam 3 years ago
parent 01be1a9955
commit a35642601c

@ -13,6 +13,7 @@ const categories = require('../categories');
const plugins = require('../plugins'); const plugins = require('../plugins');
const meta = require('../meta'); const meta = require('../meta');
const middlewareHelpers = require('../middleware/helpers'); const middlewareHelpers = require('../middleware/helpers');
const utils = require('../utils');
const helpers = module.exports; const helpers = module.exports;
@ -227,7 +228,7 @@ helpers.buildBreadcrumbs = function (crumbs) {
crumbs.forEach((crumb) => { crumbs.forEach((crumb) => {
if (crumb) { if (crumb) {
if (crumb.url) { if (crumb.url) {
crumb.url = relative_path + crumb.url; crumb.url = `${utils.isRelativeUrl(crumb.url) ? relative_path : ''}${crumb.url}`;
} }
breadcrumbs.push(crumb); breadcrumbs.push(crumb);
} }

Loading…
Cancel
Save