Merge branch 'main' of git@github.com:cdransf/coryd.dev.git
This commit is contained in:
commit
ad8c48bc04
8 changed files with 2223 additions and 227 deletions
|
@ -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',
|
||||
}
|
||||
))
|
||||
})
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
Reference in a new issue