Turning a slug into a display title is a fallback for missing editorial metadata. Acronyms and proper names often need an explicit title override.
Worked example
// app/guide/[slug]/page.tsx
export default async function SlugTitleFormatter({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
return (
<h1>
{slug
.split("-")
.filter(Boolean)
.map((s) => s[0].toUpperCase() + s.slice(1))
.join(" ")}
</h1>
);
}Implementation notes
Repeatedly deriving slugs from changing headlines breaks old links. Store the stable route key separately from the display title.
Try it yourself
Compare a simple hyphenated phrase with a slug containing an acronym.
Open the Next.js example →Editorial date July 3, 2025 · Published December 6, 2026