Socket
Socket
Sign inDemoInstall

@11ty/eleventy-plugin-rss

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@11ty/eleventy-plugin-rss - npm Package Compare versions

Comparing version 2.0.0-beta.4 to 2.0.0-beta.5

2

package.json
{
"name": "@11ty/eleventy-plugin-rss",
"version": "2.0.0-beta.4",
"version": "2.0.0-beta.5",
"description": "A pack of Eleventy plugins for generating an RSS feed using the Nunjucks templating engine.",

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

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

function getFeedContent(type, { stylesheet, collectionName, limit }) {
let stylesheetUrl = stylesheet?.[type];
// Note: page.lang comes from the i18n plugin: https://www.11ty.dev/docs/plugins/i18n/#page.lang

@@ -12,3 +13,3 @@

return `<?xml version="1.0" encoding="utf-8"?>
${stylesheet ? `<?xml-stylesheet href="${stylesheet}" type="text/xsl"?>\n` : ""}<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.base | addPathPrefixToFullUrl }}" xmlns:atom="http://www.w3.org/2005/Atom">
${stylesheetUrl ? `<?xml-stylesheet href="${stylesheetUrl}" type="text/xsl"?>\n` : ""}<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.base | addPathPrefixToFullUrl }}" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>

@@ -38,3 +39,3 @@ <title>{{ metadata.title }}</title>

return `<?xml version="1.0" encoding="utf-8"?>
${stylesheet ? `<?xml-stylesheet href="${stylesheet}" type="text/xsl"?>\n` : ""}<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ metadata.language or page.lang }}">
${stylesheetUrl ? `<?xml-stylesheet href="${stylesheetUrl}" type="text/xsl"?>\n` : ""}<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ metadata.language or page.lang }}">
<title>{{ metadata.title }}</title>

@@ -113,6 +114,10 @@ <subtitle>{{ metadata.subtitle }}</subtitle>

collectionName: false, // required
limit: 0, // limit number of entries, 0 means no limit
files: {
"atom": "/feed.xml"
// rss and json also supported
atom: "/feed.xml",
},
limit: 0, // limit number of entries, 0 means no limit
templateData: {
// atom: {},
},
metadata: {

@@ -135,3 +140,3 @@ title: "Blog Title",

let templateData = {
eleventyExcludeFromCollections: true,
eleventyExcludeFromCollections: [ options.collectionName ],
eleventyImport: {

@@ -151,3 +156,3 @@ collections: [ options.collectionName ],

return array.slice(0, n);
}
},
};

@@ -160,3 +165,3 @@

if(Array.isArray(files) && files.length === 2) {
if(Array.isArray(files) && files.length >= 2) {
[inputPath, outputPath] = files;

@@ -172,2 +177,3 @@ } else if(typeof files === "string") {

permalink: outputPath,
...options?.templateData?.[type] || {},
...templateData,

@@ -174,0 +180,0 @@ };

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc