recently, after building a blog with hexo+githubPages, configure it according to https://blog.csdn.net/qq_3369., and then use the hexo g command to solve the following error.
where the url_for.js file is as follows:
"use strict";
const url = require("url");
const _ = require("lodash");
function urlForHelper(path = "/", options) {
if (path[0] === "-sharp" || path.substring(0, 2) === "//") {
return path;
}
const config = this.config;
const root = config.root;
const data = url.parse(path);
options = _.assign({
relative: config.relative_link
}, options);
// Exit if this is an external path
if (data.protocol) {
return path;
}
// Resolve relative url
if (options.relative) {
return this.relative_url(this.path, path);
}
// Prepend root path
path = root + path;
return path.replace(/\/{2,}/g, "/");
}
module.exports = urlForHelper;
did not find a suitable way to try, is there any great god who has encountered this kind of problem