rss link to url if available
This commit is contained in:
parent
4a770b61b6
commit
2703f1b987
|
@ -15,11 +15,15 @@ function escapeXml (unsafe) {
|
|||
}
|
||||
|
||||
const generateRssItem = (item) => {
|
||||
const guid = `${SITE_URL}/items/${item.id}`
|
||||
const link = item.url || guid
|
||||
return `
|
||||
<item>
|
||||
<guid>${SITE_URL}/items/${item.id}</guid>
|
||||
<title>${escapeXml(item.title)}</title>
|
||||
<link>${SITE_URL}/items/${item.id}</link>
|
||||
<link>${link}</link>
|
||||
<comments>${guid}</comments>
|
||||
<description><![CDATA[<a href="${guid}">Comments</a>]]></description>
|
||||
<pubDate>${new Date(item.createdAt).toUTCString()}</pubDate>
|
||||
</item>
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue