hexo-theme-next
Version:
Elegant and powerful theme for Hexo.
22 lines (14 loc) • 537 B
JavaScript
/* global hexo */
;
const path = require('path');
// Add comment
hexo.extend.filter.register('theme_inject', injects => {
const config = hexo.theme.config.utterances;
if (!config.enable) return;
if (!config.repo) {
hexo.log.warn('utterances.repo can\'t be null.');
return;
}
injects.comment.raw('utterances', '<div class="comments utterances-container"></div>', {}, { cache: true });
injects.bodyEnd.file('utterances', path.join(hexo.theme_dir, 'layout/_third-party/comments/utterances.njk'));
});