import type { CollectionEntry } from "astro:content"; export type MicroEntry = CollectionEntry<"micro">; export function sortMicroEntries(entries: MicroEntry[]): MicroEntry[] { return entries.sort((a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()); } export async function getAllMicroPosts(): Promise { const { getCollection } = await import("astro:content"); // Get only Pleroma micro posts try { const microPosts = await getCollection("micro"); return sortMicroEntries(microPosts); } catch (error) { console.warn("Micro collection not available:", error); return []; } }