forked from auroral-ui/hexo-plugin-aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (48 loc) · 1.75 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const appRoot = require('app-root-path');
const chalk = require('chalk');
const pluginPack = require('./package.json');
const { throwInfo, throwError } = require('./lib/helpers/utils');
require('./lib/highlighter')(hexo);
require('./lib/filters')(hexo);
require('./lib/generators')(hexo);
require('./lib/injector')(hexo);
require('./lib/commands')(hexo);
var themePack;
try {
themePack = require(appRoot + '/node_modules/hexo-theme-aurora-s/package.json');
} catch (error) {
throwInfo(
'Aurora Plugin',
`Aurora Plugin fail to get current Aurora Theme version from package location, trying to get from themes folder instead...`
);
try {
themePack = require(appRoot + '/themes/aurora/package.json');
} catch (error) {
throwError(
'Aurora Plugin Error',
`Aurora Plugin fail to get current Aurora Theme version, please make sure you have the theme installed.`
);
return;
}
}
hexo.on('generateAfter', function () {
console.log(
chalk.green('INFO ') +
chalk.yellow('API data generated with ') +
chalk.cyan.bold('hexo-plugin-aurora-s') +
chalk.magenta(' v' + pluginPack.version)
);
});
hexo.on('exit', function () {
console.log(
chalk.green('INFO ') +
'Thanks for using: ' +
chalk.cyan.bold('hexo-plugin-aurora-s') +
chalk.magenta(' v' + pluginPack.version) +
' & ' +
chalk.cyan.bold('hexo-theme-aurora-s') +
chalk.magenta(' v' + themePack.version)
);
console.log(chalk.green('INFO ') + 'Crafted by ' + chalk.cyan.bold('bennyxguo <三钻> & Tim'));
console.log(chalk.red('INFO ') + '注意⚠' + chalk.cyan.bold('如果html生成步骤有warning,请将_config.yml中的主题设为hexo-theme-aurora-s同时将配置文件重命名为_config.aurora-s.yml'));
});