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

16 lines
358 B
JavaScript
Raw Normal View History

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',
2024-01-14 16:42:20 +08:00
layout: ['categories'],
data: locals.posts
2021-02-22 14:12:34 +08:00
}
} else {
2024-01-14 16:42:20 +08:00
return {}
2021-02-19 23:33:19 +08:00
}
2024-01-14 16:42:20 +08:00
})