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-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
|
|
|
|
});
|