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