Add RSS markdown template support
This commit is contained in:
@@ -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) {
|
||||
|
||||
13
source/templates/markdown/partials/rss.ejs
Normal file
13
source/templates/markdown/partials/rss.ejs
Normal file
@@ -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
|
||||
<%_ } _%>
|
||||
<%_ } _%>
|
||||
Reference in New Issue
Block a user