Skip to content

Commit

Permalink
配置问题 #131
Browse files Browse the repository at this point in the history
  • Loading branch information
nexmoe committed Jun 5, 2021
1 parent 60bbcf9 commit 275aaa2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions index.js
@@ -0,0 +1,2 @@
// 这个文件用来防止 hexo 5.0.0 使用 "hexo clean" 命令报错。
// This file is used to prevent hexo 5.0.0 from using "hexo clean" command error.
13 changes: 13 additions & 0 deletions move_config.js
@@ -0,0 +1,13 @@
const fs = require('fs')

if (fs.existsSync('../hexo/package.json')){
const version = JSON.parse(fs.readFileSync('../hexo/package.json')).version
if (version.split('.')[0] === '5') {
const oldConfigPath = '../../_config.old.yml'
const configPath = '../../_config.webstack.yml'
if (!fs.existsSync(configPath) && !fs.existsSync(oldConfigPath)) {
fs.writeFileSync(configPath, fs.readFileSync('./_config.yml'))
}
fs.unlinkSync('./_config.yml')
}
}
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -9,10 +9,11 @@
],
"author": "Nexmoe (https://github.com/nexmoe)",
"license": "Apache-2.0",
"main": "package.json",
"main": "index.js",
"scripts": {
"eslint": "eslint scripts/ source/js --fix",
"test": "echo test"
"test": "echo test",
"postinstall": "node ./move_config.js"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion scripts/helper/js_auto_version.js
Expand Up @@ -10,7 +10,7 @@ function jsAutoVersionHelper(...args) {
if (!path.includes('?') && !path.endsWith('.js')) path += '.js';
let url_suffix = "?v=" + new Date().getTime();
let url = this.url_for(path) + url_suffix;
return `${result}<script src="${url}"></script>`;
return `${result}<script async src="${url}"></script>`;
}, '');
}

Expand Down
2 changes: 1 addition & 1 deletion source/css/style.styl
Expand Up @@ -15,7 +15,7 @@ a {
}

body {
max-width: 1160px;
max-width: 1100px;
margin: auto !important;
}

Expand Down

0 comments on commit 275aaa2

Please sign in to comment.