Blog Post Title 11 Engineering Thoughts

March 20, 2026·5 min read
This is a demonstration of a blog post detail page using a semantic slug in the URL.

Why Slugs Matter

Using a slug instead of a numeric ID is a web development best practice because:
  1. SEO Optimization: Search engines crawl keywords in the URL.
  2. User Experience: Users can tell what the page is about before clicking.
  3. Persistance: Even if database IDs change, the slug remains constant.

How it's implemented

In this Next.js application, we use a dynamic route folder. The framework automatically passes the URL segment to the page component as a parameter.
Example Code
// File: src/app/blog/[slug]/page.tsx
export default async function BlogPost({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;
  const post = await getPostBySlug(slug);
  return <article>{/* ... */}</article>;
}
Hank Wong
Hank WongAuthor