chore: fix link feed output
This commit is contained in:
parent
1bb9d1782e
commit
f384ae9b39
4 changed files with 7 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Reference in a new issue