Initial commit: Clinic Samen Next.js site.
Clone of clinicsamen.com with Meshkee backend integration for blog, workshops, auth, static image slots, and SEO sitemap config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
|
||||
import { blogHref, fetchBlogBySlug, getLocalBlogPost } from "@/lib/blog";
|
||||
|
||||
export const revalidate = 60;
|
||||
|
||||
/** Legacy `/blog/{slug-or-id}` → canonical `/blog/{id}/{titleSlug}`. */
|
||||
export default async function LegacyBlogRedirect({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
|
||||
const apiPost = await fetchBlogBySlug(id);
|
||||
if (apiPost) redirect(blogHref(apiPost));
|
||||
|
||||
const local = getLocalBlogPost(id);
|
||||
if (local) redirect(blogHref(local));
|
||||
|
||||
notFound();
|
||||
}
|
||||
Reference in New Issue
Block a user