chore: feed updates

This commit is contained in:
Cory Dransfeldt 2023-09-19 13:15:27 -07:00
parent 797aa959a9
commit d53d0f9505
No known key found for this signature in database
13 changed files with 666 additions and 70 deletions

View file

@ -8,15 +8,19 @@ module.exports = async function () {
const entries = feed.getEntries().catch()
const res = await entries
const activity = { posts: [] }
res.forEach((entry) =>
res.forEach((entry) => {
let excerpt = ''
if (entry.content) excerpt = entry.content
if (entry.data?.post_excerpt) excerpt = entry.data.post_excerpt
activity.posts.push({
id: entry.url,
title: entry.title,
url: entry.url,
description: entry.content || '',
content_html: entry.content || '',
description: excerpt,
content_html: excerpt,
date_published: entry.published,
})
)
})
return activity
}