hexo-generator-feed
Advanced tools
Comparing version 1.2.0 to 1.2.2
@@ -11,3 +11,5 @@ /* global hexo */ | ||
hub: '', | ||
content: true | ||
content: true, | ||
content_limit: 140, | ||
content_limit_delim: '' | ||
}, hexo.config.feed); | ||
@@ -14,0 +16,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var fs = require('fs'); | ||
var gravatar = require('hexo/lib/plugins/helper/gravatar'); | ||
@@ -13,2 +14,6 @@ env.addFilter('uriencode', function(str) { | ||
env.addFilter('noControlChars', function(str) { | ||
return str.replace(/[\x00-\x1F\x7F]/g, ''); | ||
}); | ||
var atomTmplSrc = pathFn.join(__dirname, '../atom.xml'); | ||
@@ -25,2 +30,6 @@ var atomTmpl = nunjucks.compile(fs.readFileSync(atomTmplSrc, 'utf8'), env); | ||
var posts = locals.posts.sort('-date'); | ||
posts = posts.filter(function(post) { | ||
return post.draft !== true; | ||
}); | ||
if (feedConfig.limit) posts = posts.limit(feedConfig.limit); | ||
@@ -31,5 +40,9 @@ | ||
var icon; | ||
if (config.email) icon = gravatar(config.email); | ||
var xml = template.render({ | ||
config: config, | ||
url: url, | ||
icon: icon, | ||
posts: posts, | ||
@@ -36,0 +49,0 @@ feed_url: config.root + feedConfig.path |
{ | ||
"name": "hexo-generator-feed", | ||
"version": "1.2.0", | ||
"version": "1.2.2", | ||
"description": "Feed generator plugin for Hexo", | ||
@@ -24,18 +24,22 @@ "main": "index", | ||
"author": "Tommy Chen <tommy351@gmail.com> (http://zespia.tw)", | ||
"maintainers": [ | ||
"Abner Chou <hi@abnerchou.me> (http://abnerchou.me)" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"nunjucks": "^2.4.1", | ||
"object-assign": "^4.0.1" | ||
"nunjucks": "^3.0.0", | ||
"object-assign": "^4.1.1" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^7.2.3", | ||
"chai": "^3.5.0", | ||
"cheerio": "^0.20.0", | ||
"cheerio": "^0.22.0", | ||
"eslint": "^2.4.0", | ||
"eslint-config-hexo": "^1.0.3", | ||
"hexo": "^3.0.0", | ||
"jscs": "^2.11.0", | ||
"eslint-config-hexo": "^1.0.4", | ||
"hexo": "^3.3.1", | ||
"istanbul": "^0.4.5", | ||
"jscs": "^3.0.7", | ||
"jscs-preset-hexo": "^1.0.1", | ||
"mocha": "^2.4.5", | ||
"istanbul": "^0.4.2" | ||
"mocha": "^3.2.0" | ||
} | ||
} |
@@ -16,2 +16,6 @@ # hexo-generator-feed | ||
## Use | ||
In the [front-matter](https://hexo.io/docs/front-matter.html) of your post, you can optionally add a `description` setting to write a summary for the post. Otherwise the summary will default to the excerpt or the first 140 characters of the post. | ||
## Options | ||
@@ -27,2 +31,5 @@ | ||
hub: | ||
content: | ||
content_limit: 140 | ||
content_limit_delim: ' ' | ||
``` | ||
@@ -34,1 +41,4 @@ | ||
- **hub** - URL of the PubSubHubbub hubs (Leave it empty if you don't use it) | ||
- **content** - (optional) set to 'true' to include the contents of the entire post in the feed. | ||
- **content_limit** - (optional) Default length of post content used in summary. Only used, if **content** setting is false and no custom post description present. | ||
- **content_limit_delim** - (optional) If **content_limit** is used to shorten post contents, only cut at the last occurrence of this delimiter before reaching the character limit. Not used by default. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
10063
69
42
10
1
+ Addeda-sync-waterfall@1.0.1(transitive)
+ Addedcommander@5.1.0(transitive)
+ Addednunjucks@3.2.4(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.2.10.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcliui@3.2.0(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedinvert-kv@1.0.0(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedlcid@1.0.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.20.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removednunjucks@2.5.2(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwindow-size@0.1.4(transitive)
- Removedwrap-ansi@2.1.0(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyargs@3.32.0(transitive)
Updatednunjucks@^3.0.0
Updatedobject-assign@^4.1.1