rknightuk / hexo-generator-json-feed-org

Hexo plugin to generate a JSON feed as per the jsonfeed.org specification
Other
1 stars 1 forks source link

Update limit check section to fix splice error #2

Closed sbanwart closed 4 years ago

sbanwart commented 7 years ago

When running any of the Hexo commands that would generate a new feed, like hexo server or hexo generate, I get the following error:

INFO Start processing FATAL Something's wrong. Maybe you can find the solution ... TypeError: posts.splice is not a function

I was able to fix this by changing the following line from:

if (config.limit) posts = posts.splice(0, config.limit);

to

if (config.limit) posts = posts.limit(config.limit);