diff --git a/config/data/tag-aliases.js b/config/data/tag-aliases.js index d519a852..9089f980 100644 --- a/config/data/tag-aliases.js +++ b/config/data/tag-aliases.js @@ -32,6 +32,7 @@ export default { macos: '#macOS #Apple', mastodon: '#Mastodon', music: '#Music', + mystery: '#Mystery', nonfiction: '#NonFiction', politics: '#Politics', privacy: '#Privacy', diff --git a/src/_data/books.js b/src/_data/books.js index bc7c45ba..013acb64 100644 --- a/src/_data/books.js +++ b/src/_data/books.js @@ -3,10 +3,14 @@ const require = createRequire(import.meta.url) const books = require('./json/read.json') export default async function () { - return books.map(book => ( - { + return books.map(book => { + let authors = '' + if (book['authors']?.length > 1) authors = book['authors'].join(', ') + if (book['authors']?.length === 1) authors = book['authors'][0] + + return { title: book['title'], - authors: book['authors'].length > 1 ? book['authors'].join(', ') : book['authors'][0], + authors, description: book['description'], image: `https://coryd.dev/.netlify/images/?url=${encodeURIComponent(book['thumbnail'].replace('&edge=curl', ''))}&fit=cover&w=200&h=307`, url: `https://openlibrary.org/isbn/${book['isbn']}`, @@ -15,5 +19,5 @@ export default async function () { tags: book['tags'], type: 'book', } - )) + }) }