hexo-generator-feed
Advanced tools
Comparing version 0.0.8 to 0.0.9
22
index.js
@@ -1,4 +0,2 @@ | ||
var util = hexo.util, | ||
file = util.file, | ||
extend = hexo.extend, | ||
var extend = hexo.extend, | ||
route = hexo.route, | ||
@@ -44,3 +42,3 @@ xml = require('jstoxml'); | ||
locals.posts.limit(20).each(function(item){ | ||
locals.posts.sort('date', -1).limit(20).each(function(item){ | ||
var entry = [ | ||
@@ -72,11 +70,13 @@ { | ||
if (item.tags){ | ||
var tags = []; | ||
if (item.tags || item.categories){ | ||
var items = [].concat(item.tags, item.categories), | ||
categories = []; | ||
item.tags.forEach(function(tag){ | ||
tags.push({ | ||
items.forEach(function(item){ | ||
if (!item) return; | ||
categories.push({ | ||
_name: 'category', | ||
_attrs: { | ||
scheme: tag.permalink, | ||
term: tag.name | ||
scheme: item.permalink, | ||
term: item.name | ||
} | ||
@@ -86,3 +86,3 @@ }); | ||
entry = [].concat(entry, tags); | ||
entry = [].concat(entry, categories); | ||
} | ||
@@ -89,0 +89,0 @@ |
{ | ||
"name": "hexo-generator-feed", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Feed generator plugin for Hexo", | ||
@@ -17,3 +17,3 @@ "main": "index", | ||
"engines": { | ||
"hexo": ">=0.3.0" | ||
"hexo": ">= 1.0.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3363