Skip to content

Commit f80a1bd

Browse files
committed
Add slugify’d blog title to input path to better fix inputPath conflicts.
1 parent 7a517b4 commit f80a1bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/virtualTemplate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ async function eleventyFeedPlugin(eleventyConfig, options = {}) {
9898
eleventyConfig.addPlugin(pluginRss, options.rssPluginOptions || {});
9999

100100
// Guaranteed unique
101-
let pluginHtmlBase = await eleventyConfig.resolvePlugin("@11ty/eleventy/html-base-plugin");
101+
const pluginHtmlBase = await eleventyConfig.resolvePlugin("@11ty/eleventy/html-base-plugin");
102102
eleventyConfig.addPlugin(pluginHtmlBase, options.htmlBasePluginOptions || {});
103103

104+
let slugifyFilter = eleventyConfig.getFilter("slugify");
105+
let inputPathSuffix = options?.metadata?.title ? `-${slugifyFilter(options?.metadata?.title)}` : "";
104106
options = DeepCopy({
105107
// rss and json also supported
106108
type: "atom",
@@ -109,7 +111,7 @@ async function eleventyFeedPlugin(eleventyConfig, options = {}) {
109111
limit: 0, // limit number of entries, 0 means no limit
110112
},
111113
outputPath: "/feed.xml",
112-
inputPath: `virtual:eleventy-plugin-feed-${options.type || "atom"}.njk`, // TODO make this more unique
114+
inputPath: `eleventy-plugin-feed${inputPathSuffix}-${options.type || "atom"}.njk`, // TODO make this more unique
113115
templateData: {},
114116
metadata: {
115117
title: "Blog Title",

0 commit comments

Comments
 (0)