chore: fix link feed output

This commit is contained in:
Cory Dransfeldt 2023-09-20 09:49:48 -07:00
parent 1bb9d1782e
commit f384ae9b39
No known key found for this signature in database
4 changed files with 7 additions and 5 deletions

View file

@ -1,8 +1,11 @@
const markdownIt = require('markdown-it')
const { URL } = require('url')
const BASE_URL = 'https://coryd.dev'
module.exports = {
normalizeEntries: (entries) => {
const md = markdownIt({ html: true, linkify: true })
const posts = []
entries.forEach((entry) => {
const dateKey = Object.keys(entry).find((key) => key.includes('date'))
@ -10,8 +13,8 @@ module.exports = {
let excerpt = ''
// set the entry excerpt
if (entry.data?.post_excerpt) excerpt = entry.data.post_excerpt
if (entry.description) excerpt = entry.description
if (entry.data?.post_excerpt) excerpt = md.render(entry.data.post_excerpt)
// if there's a valid entry return a normalized object
if (entry && !entry.data?.link) {