diff --git a/source/plugins/rss/index.mjs b/source/plugins/rss/index.mjs index 860cd320..426b8231 100644 --- a/source/plugins/rss/index.mjs +++ b/source/plugins/rss/index.mjs @@ -14,7 +14,7 @@ //Load rss feed const {title, description, link, items} = await (new imports.rss()).parseURL(source) //eslint-disable-line new-cap - const feed = items.map(({title, isoDate:date}) => ({title, date:new Date(date)})) + const feed = items.map(({title, link, isoDate:date}) => ({title, link, date:new Date(date)})) //Limit feed if (limit > 0) { diff --git a/source/templates/markdown/partials/rss.ejs b/source/templates/markdown/partials/rss.ejs new file mode 100644 index 00000000..f90f80ad --- /dev/null +++ b/source/templates/markdown/partials/rss.ejs @@ -0,0 +1,13 @@ +<%_ if (plugins.rss) { _%> +**[🗼 Rss feed from <%= plugins.rss?.source %>](<%= plugins.rss?.link %>)** + <%_ if (plugins.rss.error) { _%> +<%= plugins.rss.error.message _%> + <%_ } else if (plugins.rss.feed.length) { _%> + <%_ for (const {title, link, date} of plugins.rss.feed) { _%> +* [<%= title %>](<%= link %>) + * Published on <%= f.date(new Date(date), {dateStyle:"short"}) %> + <%_ } _%> + <%_ } else { _%> +Empty RSS feed + <%_ } _%> +<%_ } _%>