njsbtguide
Version:
Playground
22 lines (15 loc) • 581 B
JavaScript
/* global hexo */
;
const path = require('path');
const priority = hexo.config.inject_priority || {};
// Add comment
hexo.extend.filter.register('theme_inject', function(injects) {
let theme = hexo.theme.config;
if (!theme.livere_uid) return;
injects.comment.raw('livere', `
<div class="comments" id="comments">
<div id="lv-container" data-id="city" data-uid="{{ theme.livere_uid }}"></div>
</div>
`, {}, {cache: true});
injects.bodyEnd.file('livere', path.join(hexo.theme_dir, 'layout/_third-party/comments/livere.swig'));
}, priority.livere);