From 4b9018b6d92ef8f1854d9dc44625295c2acd3fb3 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Thu, 3 Jul 2025 13:59:59 +0300 Subject: Cleanup old notes feature --- src/utils/micro.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/utils/micro.ts') diff --git a/src/utils/micro.ts b/src/utils/micro.ts index 7344850..51d336b 100644 --- a/src/utils/micro.ts +++ b/src/utils/micro.ts @@ -1,6 +1,6 @@ import type { CollectionEntry } from "astro:content"; -export type MicroEntry = CollectionEntry<"note">; +export type MicroEntry = CollectionEntry<"micro">; export function sortMicroEntries(entries: MicroEntry[]): MicroEntry[] { return entries.sort((a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()); @@ -9,18 +9,12 @@ export function sortMicroEntries(entries: MicroEntry[]): MicroEntry[] { export async function getAllMicroPosts(): Promise { const { getCollection } = await import("astro:content"); - const notes = await getCollection("note"); - - // Try to get micro posts if available, otherwise just use notes + // Get only Pleroma micro posts try { const microPosts = await getCollection("micro"); - const allMicroPosts: (CollectionEntry<"note"> | CollectionEntry<"micro">)[] = [ - ...notes, - ...microPosts, - ]; - return sortMicroEntries(allMicroPosts as MicroEntry[]); + return sortMicroEntries(microPosts); } catch (error) { - console.warn("Micro collection not available, using notes only:", error); - return sortMicroEntries(notes); + console.warn("Micro collection not available:", error); + return []; } } -- cgit v1.2.3