MCPcopy
hub / github.com/midudev/libros-programacion-gratis / bookStructuredData

Function bookStructuredData

web/src/data/seo.ts:141–154  ·  view source on GitHub ↗
(book: LibraryBook)

Source from the content-addressed store, hash-verified

139};
140
141const 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
156export const createHomeStructuredData = () => ({
157 '@context': 'https://schema.org',

Callers 2

createHomeStructuredDataFunction · 0.85

Calls 2

getLocalPdfBookFunction · 0.90
toAbsoluteUrlFunction · 0.85

Tested by

no test coverage detected