Permalink
Browse files

Merge branch 'master' of https://github.com/wzpan/hexo-generator-search

  • Loading branch information...
wzpan committed Sep 14, 2018
2 parents debd8e5 + fe1df7f commit 43967782045355f5d016c394c9a638b02eb4319f
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/json_generator.js
View
@@ -39,18 +39,16 @@ module.exports = function(locals){
temp_post.content = post._content
}
if (post.tags && post.tags.length > 0) {
var tags = new Array()
var tag_index = 0
post.tags.each(function (tag) {
tags[tag_index] = tag.name;
var tags = [];
post.tags.forEach(function (tag) {
tags.push(tag.name);
});
temp_post.tags = tags
}
if (post.categories && post.categories.length > 0) {
var categories = new Array()
var cate_index = 0
post.categories.each(function (cate) {
categories[cate_index] = cate.name;
var categories = [];
post.categories.forEach(function (cate) {
categories.push(cate.name);
});
temp_post.categories = categories
}

0 comments on commit 4396778

Please sign in to comment.