import Link from "next/link"; import { draftMode } from "next/headers"; import Date from "./date"; import CoverImage from "./cover-image"; import Avatar from "./avatar"; import MoreStories from "./more-stories"; import { getAllPosts } from "@/lib/api"; import { CMS_NAME, CMS_URL } from "@/lib/constants"; function Intro() { return (

Blog.

A statically generated blog example using{" "} Next.js {" "} and{" "} {CMS_NAME} .

); } function HeroPost({ title, coverImage, date, excerpt, author, slug, }: { title: string; coverImage: any; date: string; excerpt: string; author: any; slug: string; }) { return (

{title}

{excerpt}

{author && }
); } export default async function Page() { const { isEnabled } = draftMode(); const allPosts = await getAllPosts(isEnabled); const heroPost = allPosts[0]; const morePosts = allPosts.slice(1); return (
{heroPost && ( )}
); }