chore: feed updates
This commit is contained in:
parent
797aa959a9
commit
d53d0f9505
13 changed files with 666 additions and 70 deletions
|
@ -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
|
||||
}
|
||||
|
|
Reference in a new issue