How to pass variable from generator.js in the hexo-generator-category to category.ejs in the layout folder? For example one category.name in site.categories.
How to modify this code?
return locals.categories.reduce((result, category) => {
if (!category.length) return result;
const posts = category.posts.sort(orderBy);
const data = pagination(category.path, posts, {
perPage,
layout: ['category', 'archive', 'index'],
format: paginationDir + '/%d/',
data: {
category: category.name
}
});
Is there any other way to achieve the goal?