From 7fe43a02973f1553f22b78974e26cd240114fac8 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 25 Jun 2023 11:23:38 -0700 Subject: [PATCH] fix: missing book covers --- src/_data/books.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/_data/books.js b/src/_data/books.js index 747b2246..29f9e5e8 100644 --- a/src/_data/books.js +++ b/src/_data/books.js @@ -9,7 +9,10 @@ module.exports = async function () { const res = await extract(url, { getExtraEntryFields: (feedEntry) => { return { - image: feedEntry['oku:cover'] || 'https://cdn.coryd.dev/books/missing-book.jpg', + image: + feedEntry['oku:cover'] || + `https://cdn.coryd.dev/books/${feedEntry.title.replace(/\s+/g, '-').toLowerCase()}.jpg` || + 'https://cdn.coryd.dev/books/missing-book.jpg', } }, })