-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
24 lines (18 loc) · 633 Bytes
/
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
/* global hexo */
'use strict';
const Util = require('@next-theme/utils');
const utils = new Util(hexo, __dirname);
hexo.config.fireworks = Object.assign({
enable: true,
}, hexo.config.fireworks);
const config = hexo.config.fireworks;
if (config.enable) {
hexo.extend.filter.register('theme_inject', injects => {
injects.head.raw('fireworks', '<script async src="{{ url_for("lib/fireworks.js") }}"></script>');
injects.style.push(utils.getFilePath('fireworks.styl'));
});
hexo.extend.generator.register('fireworks', () => ({
path: 'lib/fireworks.js',
data: utils.getFileContent('fireworks.js')
}));
}