-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (24 loc) · 762 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
25
26
27
28
29
const config = {};
/**
* Get config.
*
* @return {void}
*/
async function initConfig() {
if (!hexo.config.fb_comments) return;
hexoConfig = hexo.config.fb_comments;
if (!hexoConfig.enabled) return;
config.to = hexoConfig.to || 'post';
config.lang = hexoConfig.lang || 'zh_TW';
config.appId = hexoConfig.app_id || null;
config.numPosts = hexoConfig.num_posts || 5;
config.orderBy = hexoConfig.order_by || 'reverse-time';
config.colorscheme = hexoConfig.colorscheme || 'light';
config.width = hexoConfig.width || '100%';
}
initConfig().then(() => {
hexo.extend.injector.register(
'head_end', require('./head')(config), config?.to);
hexo.extend.tag.register(
'fb_comments', require('./tag')(config), {async: true});
});