nomadro/app/community/blog/[slug]/page.tsx
eric 9928c5185b Mount nav/book/community as native App Router routes in one Next process.
Replace reverse-proxy/iframe approach with @ebook/@community/@navmini imports under /nav /book /community so localhost:3000 serves all three products directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 03:49:16 -05:00

28 lines
843 B
TypeScript

import { api } from "@community/lib/api";
import { notFound } from "next/navigation";
import SiteShell from "@community/components/SiteShell";
import BlogReadingProgress from "@community/components/BlogReadingProgress";
import BlogDetailClient from "@community/components/BlogDetailClient";
export default async function BlogDetailPage({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params;
let post;
let allPosts;
try {
[post, allPosts] = await Promise.all([api.getBlogPost(slug), api.getBlog()]);
} catch {
notFound();
}
const related = allPosts
.filter((p) => p.slug !== slug && p.tags.some((tag) => post.tags.includes(tag)))
.slice(0, 3);
return (
<SiteShell>
<BlogReadingProgress />
<BlogDetailClient post={post} related={related} />
</SiteShell>
);
}