Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Sep 14, 2018
2 parents debd8e5 + fe1df7f commit 4396778
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/json_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4396778

Please sign in to comment.