--- import { getCollection } from 'astro:content'; import '../styles/themes.css'; export interface Props { title?: string; description?: string; } const { title = 'YouTube Wisdom Library', description = 'A curated collection of insights from the best talks', } = Astro.props; // Get all talks for the sidebar const talks = await getCollection('talks'); const currentPath = Astro.url.pathname; // Sort talks by date (newest first) const sortedTalks = talks.sort((a, b) => { return new Date(b.data.date).getTime() - new Date(a.data.date).getTime(); }); // Group talks by speaker const talksBySpeaker = sortedTalks.reduce( (acc, talk) => { const speaker = talk.data.speaker; if (!acc[speaker]) { acc[speaker] = []; } acc[speaker].push(talk); return acc; }, {} as Record ); --- {title}
📚 Wisdom Library
🏠 Home 🎤 Speakers ⚙️ Admin

RECENT TALKS

{ Object.entries(talksBySpeaker).map(([speaker, speakerTalks]) => (
{speaker} {speakerTalks.length}
{speakerTalks.map((talk) => { const isActive = currentPath.includes(talk.slug); return (
{talk.data.title}
{talk.data.category.replace('-', ' ')} {new Date(talk.data.date).toLocaleDateString('de-DE', { day: 'numeric', month: 'short', })}
); })}
)) }

APPEARANCE

📚 Wisdom Library
Home Speakers