import Link from "next/link"; import { notFound } from "next/navigation"; import type { Metadata } from "next"; import { MDXRemote } from "next-mdx-remote/rsc"; import remarkGfm from "remark-gfm"; import { getAdjacentPosts, getAllPosts, getPost } from "@/lib/devblog"; type Props = { params: Promise<{ slug: string }> }; export function generateStaticParams() { return getAllPosts().map((p) => ({ slug: p.slug })); } export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const post = getPost(slug); if (!post) return {}; const url = `https://highlandgamesstudio.com/devblog/${post.slug}`; return { title: post.title, description: post.excerpt, alternates: { canonical: url }, openGraph: { type: "article", title: post.title, description: post.excerpt, url, publishedTime: post.date, authors: post.author ? [post.author] : undefined, tags: post.tags, }, twitter: { card: "summary_large_image", title: post.title, description: post.excerpt, }, }; } function formatDate(date: string) { return new Date(date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", }); } const mdxComponents = { h1: (props: React.HTMLAttributes) => (

), h2: (props: React.HTMLAttributes) => (

), h3: (props: React.HTMLAttributes) => (

), p: (props: React.HTMLAttributes) => (

), ul: (props: React.HTMLAttributes) => (