Socket
Socket
Sign inDemoInstall

@11ty/eleventy-plugin-rss

Package Overview
Dependencies
35
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "@11ty/eleventy-plugin-rss",
"version": "2.0.0",
"version": "2.0.1",
"description": "Generate an Atom, RSS, or JSON feed with Eleventy.",

@@ -5,0 +5,0 @@ "publishConfig": {

@@ -18,3 +18,3 @@ const pkg = require("../package.json");

<language>{{ metadata.language or page.lang }}</language>
{%- for post in collections.${collection.name} | reverse | head(${collection.limit}) %}
{%- for post in collections.${collection.name} | reverse | eleventyFeedHead(${collection.limit}) %}
{%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %}

@@ -50,3 +50,3 @@ <item>

</author>
{%- for post in collections['${collection.name}'] | reverse | head(${collection.limit}) %}
{%- for post in collections['${collection.name}'] | reverse | eleventyFeedHead(${collection.limit}) %}
{%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %}

@@ -80,3 +80,3 @@ <entry>

"items": [
{%- for post in collections['${collection.name}'] | reverse | head(${collection.limit}) %}
{%- for post in collections['${collection.name}'] | reverse | eleventyFeedHead(${collection.limit}) %}
{%- set absolutePostUrl %}{{ post.url | htmlBaseUrl(metadata.base) }}{% endset %}

@@ -148,14 +148,15 @@ {

metadata: options.metadata,
// Get the first `n` elements of a collection.
head: function(array, n) {
if(!n || n === 0) {
return array;
}
if(n < 0) {
throw new Error("`collection.limit` option must be a positive number.");
}
return array.slice(0, n);
},
};
// Get the first `n` elements of a collection.
eleventyConfig.addFilter("eleventyFeedHead", function(array, n) {
if(!n || n === 0) {
return array;
}
if(n < 0) {
return array.slice(n);
}
return array.slice(0, n);
});
eleventyConfig.addTemplate(options.inputPath, getFeedContent(options), templateData);

@@ -162,0 +163,0 @@ };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc