fix errors with missing descriptions

This commit is contained in:
Dakedres 2024-05-28 22:19:24 -06:00
parent 4ed28e7e6d
commit 9b9d25504e

9
lib.js
View File

@ -210,7 +210,7 @@ export const createPosts = async (channel, source, fromDate, reducerCallback) =>
export const createPost = (item, source) => {
let description = item.querySelector('description')
description = description === null ? '' : new JSDOM(description.textContent).window.document
description = new JSDOM(description === null ? '' : description.textContent).window.document
let date = readPubDate(item.querySelector('pubDate'))
let link = item.querySelector('link')?.textContent
@ -424,12 +424,14 @@ export const imageExtensions = {
'image/avif': '.avif',
'image/bmp': '.bmp',
'image/gif': '.gif',
'image/gifv': '.gifv',
'image/vnd.microsoft.icon': '.icon',
'image/jpeg': '.jpg',
'image/png': '.png',
'image/svg+xml': '.xml',
'image/tiff': '.tif',
'image/webp': '.webp'
'image/webp': '.webp',
'image/webm': '.gifv'
}
export const pullImages = async (post, view, discardPostIfNoImages = false, getPostId = getPostIdFromPathname) => {
@ -550,6 +552,7 @@ export const writeView = (sources, feeds, view) => {
}
for(let page of pages) {
console.log('Writing page', page)
writePage(page, view)
}
@ -596,6 +599,8 @@ export const createPages = (list, view) => {
}
}
console.log(list)
return pages
}