-
Notifications
You must be signed in to change notification settings - Fork 2
/
icon.js
22 lines (18 loc) · 694 Bytes
/
icon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
const { install } = require('@jiangtj/hexo-icon-svg-core/lib/install');
const { icon } = require('@jiangtj/hexo-icon-svg-core/lib/core');
const { faCss } = require('@jiangtj/hexo-icon-svg-core/lib/icons/fortawesome');
const compatibleFaInline = hexo => {
function faInline(iconName, opts) {
const options = opts || {prefix: 'fas'};
const prefix = options.prefix;
return icon({prefix: prefix, iconName: iconName}, {type: 'fa'});
}
hexo.extend.helper.register('fa_inline', faInline);
};
module.exports = hexo => {
install(hexo);
const injector = require('hexo-extend-injector2')(hexo);
injector.register('style', faCss());
compatibleFaInline(hexo);
};