@@ -68,16 +71,13 @@ const nextBook = currentIndex < mimsBooks.length - 1 ? mimsBooks[currentIndex +
- {topics.slice(0, 5).map((topic) => (
-
- {topic.replace(/-/g, ' ')}
-
+ {topics.map((topic) => (
+
+
+ {topic.replace(/-/g, ' ')}
+
+
))}
- {topics.length > 5 && (
-
- +{topics.length - 5} more
-
- )}
@@ -124,6 +124,9 @@ const nextBook = currentIndex < mimsBooks.length - 1 ? mimsBooks[currentIndex +
/>
+
+
+
{prevBook ? (
diff --git a/site/src/pages/uglys/[slug].astro b/site/src/pages/uglys/[slug].astro
index 7f8f14e..3472035 100644
--- a/site/src/pages/uglys/[slug].astro
+++ b/site/src/pages/uglys/[slug].astro
@@ -3,6 +3,8 @@ import Layout from '@/layouts/Layout.astro';
import { Badge } from '@/components/ui/badge';
import EBookReader from '@/components/EBookReader';
import { getCollection, type CollectionEntry } from 'astro:content';
+import { getRelatedBooks } from '@/lib/related-books';
+import RelatedBooks from '@/components/RelatedBooks.astro';
export async function getStaticPaths() {
const books = await getCollection('books');
@@ -30,6 +32,7 @@ const uglysBooks = allBooks
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;
+const relatedBooks = getRelatedBooks(book, allBooks);
---
@@ -68,16 +71,13 @@ const nextBook = currentIndex < uglysBooks.length - 1 ? uglysBooks[currentIndex
- {topics.slice(0, 5).map((topic) => (
-
- {topic.replace(/-/g, ' ')}
-
+ {topics.map((topic) => (
+
+
+ {topic.replace(/-/g, ' ')}
+
+
))}
- {topics.length > 5 && (
-
- +{topics.length - 5} more
-
- )}
@@ -124,6 +124,9 @@ const nextBook = currentIndex < uglysBooks.length - 1 ? uglysBooks[currentIndex
/>
+
+
+
{prevBook ? (