hexo-theme-stellar/scripts/generators/topic.js

22 lines
491 B
JavaScript

/**
* topic v1 | https://github.com/xaoxuu/hexo-theme-stellar/
*/
hexo.extend.generator.register('topic', function (locals) {
const { site_tree, topic } = hexo.theme.config
const topicIdList = Object.keys(topic.tree)
if (topicIdList.length == 0) {
return {}
}
var ret = []
ret.push({
path: site_tree.topic.base_dir + '/index.html',
layout: ['index_topic'],
data: {
layout: 'index_topic',
menu_id: site_tree.topic.menu_id
}
})
return ret
})