import type { InferGetStaticPropsType } from "next"; import Link from "next/link"; import Container from "../../components/container"; import distanceToNow from "../../lib/dateRelative"; import { getAllPosts } from "../../lib/getPost"; export default function NotePage({ allPosts, }: InferGetStaticPropsType) { return ( {allPosts.length ? ( allPosts.map((post) => (
{post.title}

{post.excerpt}

)) ) : (

No blog posted yet :/

)}
); } export async function getStaticProps() { const allPosts = getAllPosts(["slug", "title", "excerpt", "date"]); return { props: { allPosts }, }; }