export const dynamic = "force-dynamic"; import type { Metadata } from "next"; import Link from "next/link"; import { PageHeader } from "@/components/page-header"; import { buildOgMeta } from "@/lib/og"; import { prisma } from "@/lib/db"; import { EssaysGrid } from "./essays-grid"; export function generateMetadata(): Metadata { return buildOgMeta({ title: "Essays", detail: "Standalone essays by Śrīla Prabhupāda", quote: "Foundational essays on the science of Kṛṣṇa consciousness by His Divine Grace A.C. Bhaktivedanta Swami Prabhupāda.", }); } async function getAllEssays() { return prisma.essay.findMany({ orderBy: [{ group: "asc" }, { order: "asc" }], select: { slug: true, title: true, year: true, group: true }, }); } export default async function EssaysPage() { const essays = await getAllEssays(); const items = essays.map((essay) => ({ slug: essay.slug, title: essay.title, year: essay.year, group: essay.group, href: `/essays/${essay.slug}`, })); return (
Standalone essays by Śrīla Prabhupāda