|
1 | 1 | import fs from "node:fs"; |
2 | 2 | import eleventySass from "@11tyrocks/eleventy-plugin-sass-lightningcss"; |
3 | 3 | import eleventyNavigation from "@11ty/eleventy-navigation"; |
4 | | -import { feedPlugin } from "@11ty/eleventy-plugin-rss"; |
| 4 | +import pluginRss from "@11ty/eleventy-plugin-rss"; |
5 | 5 |
|
6 | 6 | export default async function (eleventyConfig) { |
7 | 7 | // copy all `src/assets` to `_site/static" |
@@ -83,24 +83,19 @@ export default async function (eleventyConfig) { |
83 | 83 | return input.startsWith(prefix); |
84 | 84 | }); |
85 | 85 |
|
| 86 | + // Format authors array with comma separation |
| 87 | + eleventyConfig.addFilter("formatAuthors", (authorKeys, authorsData) => { |
| 88 | + if (!Array.isArray(authorKeys) || !authorsData) return ""; |
| 89 | + |
| 90 | + const authorNames = authorKeys |
| 91 | + .map((key) => authorsData[key]?.name) |
| 92 | + .filter((name) => name); // Remove empty names |
| 93 | + |
| 94 | + return authorNames.join(", "); |
| 95 | + }); |
| 96 | + |
86 | 97 | // RSS feed |
87 | | - eleventyConfig.addPlugin(feedPlugin, { |
88 | | - type: "atom", // or "rss", "json" |
89 | | - outputPath: "/feed.xml", |
90 | | - collection: { |
91 | | - name: "posts", // iterate over `collections.posts` |
92 | | - limit: 10, // 0 means no limit |
93 | | - }, |
94 | | - metadata: { |
95 | | - language: "en", |
96 | | - title: "Invenio Blog", |
97 | | - subtitle: "Follow news and updates on Invenio world.", |
98 | | - base: "https://inveniosoftware.org/blog/", |
99 | | - author: { |
100 | | - name: "Invenio Software", |
101 | | - |
102 | | - }, |
103 | | - }, |
| 98 | + eleventyConfig.addPlugin(pluginRss, { |
104 | 99 | htmlBasePluginOptions: { |
105 | 100 | baseHref: "", |
106 | 101 | }, |
|
0 commit comments