chore: update hexo-component-inferno and migration script

This commit is contained in:
ppoffice 2022-08-20 16:12:59 -04:00
parent 3aebb2aeae
commit 3bc0a94281
No known key found for this signature in database
GPG Key ID: D872802C1F2A16AA
3 changed files with 31 additions and 2 deletions

View File

@ -1 +1 @@
module.exports = require('./v4_v5');
module.exports = require('./v5_v5.1');

View File

@ -0,0 +1,29 @@
const Migration = require('hexo-component-inferno/lib/core/migrate').Migration;
module.exports = class extends Migration {
constructor() {
super('5.1.0', null);
}
upgrade(config) {
// Upgrade Waline configurations from v1 to v2.
const comment = config.comment || {};
const renamedOptions = {
'visitor': 'pageview',
'uploadImage': 'image_uploader',
'highlight': 'highlighter',
'math': 'tex_renderer'
};
if (comment.type === 'waline') {
for (const option in renamedOptions) {
if (typeof comment[option] !== 'undefined') {
if (typeof comment[renamedOptions[option]] === 'undefined') {
comment[renamedOptions[option]] = comment[option];
}
delete comment[option];
}
}
}
return config;
}
};

View File

@ -30,7 +30,7 @@
"bulma-stylus": "0.8.0",
"deepmerge": "^4.2.2",
"hexo": "^6.0.0",
"hexo-component-inferno": "^1.2.0",
"hexo-component-inferno": "^2.0.0",
"hexo-log": "^3.0.0",
"hexo-pagination": "^2.0.0",
"hexo-renderer-inferno": "^0.1.3",