--- import Layout from '@/layouts/Layout.astro'; import { Badge } from '@/components/ui/badge'; import EBookReader from '@/components/EBookReader'; import { getCollection, type CollectionEntry } from 'astro:content'; export async function getStaticPaths() { const books = await getCollection('books'); return books .filter(book => book.data.collection === 'uglys') .map(book => ({ params: { slug: book.slug.split('/').pop() }, props: { book } })); } interface Props { book: CollectionEntry<'books'>; } const { book } = Astro.props; const { title, shortTitle, description, topics, localPdf, coverImage, year, archiveOrgUrl, formats } = book.data; // Get all uglys books for navigation const allBooks = await getCollection('books'); const uglysBooks = allBooks .filter(b => b.data.collection === 'uglys') .sort((a, b) => a.data.sortOrder - b.data.sortOrder); const currentIndex = uglysBooks.findIndex(b => b.slug === book.slug); const prevBook = currentIndex > 0 ? uglysBooks[currentIndex - 1] : null; const nextBook = currentIndex < uglysBooks.length - 1 ? uglysBooks[currentIndex + 1] : null; ---
Home Ugly's Collection {shortTitle}
{year && (
{year} Edition
)}

{title}

{description}

{topics.slice(0, 5).map((topic) => ( {topic.replace(/-/g, ' ')} ))} {topics.length > 5 && ( +{topics.length - 5} more )}
Download {archiveOrgUrl && ( Archive.org )}