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

27 lines
594 B
JavaScript
Raw Permalink 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)) {
2024-01-22 15:56:40 +08:00
var author = authors[key]
2024-01-04 22:50:57 +08:00
if (author.hidden) {
continue
}
2024-01-22 15:56:40 +08:00
author.id = key
2024-01-04 22:50:57 +08:00
pages.push({
path: author.path,
layout: ['archive'],
data: {
2024-01-14 16:42:20 +08:00
author: author,
2024-02-04 21:09:44 +08:00
leftbar: site_tree.author.leftbar,
menu_id: site_tree.author.menu_id,
breadcrumb: false
2024-01-04 22:50:57 +08:00
}
})
}
return pages
});