From c1c7ca70783cbb38cf35fe0c9fb05dd626f46c08 Mon Sep 17 00:00:00 2001 From: Nikhil M Warrier Date: Tue, 3 Mar 2026 09:00:53 +0530 Subject: Rename Author to Member, add Codeberg icons --- src/lib/data-utils.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/lib/data-utils.ts') diff --git a/src/lib/data-utils.ts b/src/lib/data-utils.ts index ab0176f..6e4439f 100644 --- a/src/lib/data-utils.ts +++ b/src/lib/data-utils.ts @@ -1,8 +1,8 @@ import { getCollection, render, type CollectionEntry } from 'astro:content' import { readingTime, calculateWordCountFromHtml } from '@/lib/utils' -export async function getAllAuthors(): Promise[]> { - return await getCollection('authors') +export async function getAllMembers(): Promise[]> { + return await getCollection('members') } export async function getAllPosts(): Promise[]> { @@ -23,8 +23,7 @@ export async function getAllPostsAndSubposts(): Promise< export async function getAllEvents(): Promise[]> { const events = await getCollection('events') - return events - .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()) + return events.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()) } export function groupEventsByYear( @@ -62,7 +61,7 @@ export async function getAllTags(): Promise> { export async function getAllTypes(): Promise> { const events = await getAllEvents() return events.reduce((acc, event) => { - acc.set(event.data.type, (acc.get(event.data.type) || 0) + 1) + acc.set(event.data.type, (acc.get(event.data.type) || 0) + 1) return acc }, new Map()) } @@ -248,7 +247,7 @@ export async function getParentPost( export async function parseAuthors(authorIds: string[] = []) { if (!authorIds.length) return [] - const allAuthors = await getAllAuthors() + const allAuthors = await getAllMembers() const authorMap = new Map(allAuthors.map((author) => [author.id, author])) return authorIds.map((id) => { -- cgit v1.2.3