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

25 lines
549 B
JavaScript
Raw Normal View History

2024-01-04 22:50:57 +08:00
/**
* author v1 | https://github.com/xaoxuu/hexo-theme-stellar/
*/
hexo.extend.generator.register('author', function (locals) {
2024-01-14 17:21:19 +08:00
const { site_tree, authors } = hexo.theme.config
2024-01-04 22:50:57 +08:00
var pages = []
for (let key of Object.keys(authors)) {
const author = authors[key]
if (author.hidden) {
continue
}
pages.push({
path: author.path,
layout: ['archive'],
data: {
2024-01-14 16:42:20 +08:00
author: author,
2024-01-14 17:21:19 +08:00
sidebar: site_tree.author.sidebar,
menu_id: site_tree.author.menu_id
2024-01-04 22:50:57 +08:00
}
})
}
return pages
});