Add category tag to RSS feed (#534)

Co-authored-by: ekzyis <ek@stacker.news>
This commit is contained in:
ekzyis 2023-10-03 02:20:13 +02:00 committed by GitHub
parent 65fa3cf966
commit c0c691eda5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ const generateRssItem = (item) => {
if (item.isJob) {
title = item.title + ' \\ ' + item.company + ' \\ ' + `${item.location || ''}${item.location && item.remote ? ' or ' : ''}${item.remote ? 'Remote' : ''}`
}
const category = item.subName ? `<category domain="${SITE_URL}/~${item.subName}">${item.subName}</category>` : '<category></category>'
return `
<item>
<guid>${guid}</guid>
@ -31,6 +32,7 @@ const generateRssItem = (item) => {
<comments>${guid}</comments>
<description><![CDATA[<a href="${guid}">Comments</a>]]></description>
<pubDate>${new Date(item.createdAt).toUTCString()}</pubDate>
${category}
<atom:author><atom:name>${item.user.name}</atom:name></atom:author>
</item>
`