(book: LibraryBook)
| 139 | }; |
| 140 | |
| 141 | const bookStructuredData = (book: LibraryBook) => { |
| 142 | const pdfBook = getLocalPdfBook(book); |
| 143 | const primaryHref = pdfBook && pdfBook.href === pdfBook.pdfHref ? pdfBook.readerPath : book.href; |
| 144 | |
| 145 | return { |
| 146 | '@type': 'Book', |
| 147 | name: book.title, |
| 148 | ...(book.author && { author: { '@type': 'Person', name: book.author } }), |
| 149 | url: toAbsoluteUrl(primaryHref), |
| 150 | inLanguage: siteConfig.language, |
| 151 | isAccessibleForFree: true, |
| 152 | ...(book.formats?.length && { encodingFormat: book.formats.map(getEncodingFormat) }), |
| 153 | }; |
| 154 | }; |
| 155 | |
| 156 | export const createHomeStructuredData = () => ({ |
| 157 | '@context': 'https://schema.org', |
no test coverage detected