2021-02-19 23:33:19 +08:00
|
|
|
/**
|
|
|
|
* categories v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
|
|
*/
|
|
|
|
|
|
|
|
hexo.extend.generator.register('categories', function (locals) {
|
2021-02-22 14:12:34 +08:00
|
|
|
if (locals.categories && locals.categories.length > 0) {
|
|
|
|
return {
|
|
|
|
path: hexo.config.category_dir + '/index.html',
|
|
|
|
data: locals.posts,
|
|
|
|
layout: ['categories']
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return {};
|
2021-02-19 23:33:19 +08:00
|
|
|
}
|
2021-02-22 14:12:34 +08:00
|
|
|
});
|