import Link from "next/link"; import { getPostData, getAllPostIds, getAdjacentPosts } from "@/lib/posts"; import type { PostData } from "@/lib/posts"; import Window from "@/components/window"; import TableOfContents from "@/components/table-of-contents"; import { MDXRemote } from "next-mdx-remote/rsc"; import rehypePrettyCode from "rehype-pretty-code"; import rehypeSlug from "rehype-slug"; import remarkGfm from "remark-gfm"; import Video from "@/components/video"; interface PageProps { params: Promise<{ slug: string }>; } export async function generateStaticParams() { const paths = getAllPostIds(); return paths.map((path) => ({ slug: path.params.slug })); } export async function generateMetadata({ params }: PageProps) { const { slug } = await params; const postData = await getPostData(slug); return { title: `${postData.title} | Gabriel's Kaszewski Blog`, }; } export default async function Post({ params }: PageProps) { const { slug } = await params; const postData: PostData = await getPostData(slug); const { prev, next } = getAdjacentPosts(slug); return (
{new Date(postData.date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })} {postData.readingTime}
{postData.wip && (
🚧 This post is a work in progress — content may change.
)} {/* Mobile TOC — inline above article, hidden on lg+ */} {postData.headings.length > 0 && (
)}
{/* Desktop TOC — separate Aero Window, sticky on the right */} {postData.headings.length > 0 && (
)}
{prev ? ( ← {prev.title} ) : ( )} Home {next ? ( {next.title} → ) : ( )}
); }