chore: update hexo-component-inferno and migration script
parent
3aebb2aeae
commit
3bc0a94281
|
@ -1 +1 @@
|
||||||
module.exports = require('./v4_v5');
|
module.exports = require('./v5_v5.1');
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
};
|
|
@ -30,7 +30,7 @@
|
||||||
"bulma-stylus": "0.8.0",
|
"bulma-stylus": "0.8.0",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"hexo": "^6.0.0",
|
"hexo": "^6.0.0",
|
||||||
"hexo-component-inferno": "^1.2.0",
|
"hexo-component-inferno": "^2.0.0",
|
||||||
"hexo-log": "^3.0.0",
|
"hexo-log": "^3.0.0",
|
||||||
"hexo-pagination": "^2.0.0",
|
"hexo-pagination": "^2.0.0",
|
||||||
"hexo-renderer-inferno": "^0.1.3",
|
"hexo-renderer-inferno": "^0.1.3",
|
||||||
|
|
Loading…
Reference in New Issue