"use server"; import { globby } from "globby"; export async function getSlugs() { const files = await globby("*.mdx", { cwd: "src/content" }); return files.map((file) => file.replace(/\.mdx$/, "")); } export async function getPostBySlug(slug: string) { const { metadata, default: component } = await import( `@/content/${slug}.mdx` ); return { slug, metadata, component }; }