import React from "react"; import { useRouter } from "next/router"; import AppHead from "../components/AppHead"; import FooterLinks from "../components/landing/FooterLinks"; import FadeIn from "../components/motions/FadeIn"; import NavBar from "../components/NavBar"; import { getSortedPostsData } from "../lib/posts"; export default function BlogPage({ allPostsData }) { const router = useRouter(); return (

Reblogd

{allPostsData.map(({ id, title, date, imageUrl, category, author }) => (
{ router.push(`/blog/${id}`).catch(console.error); }} >

{category.title}

{title}

{author.name}

{author.role}

))}
); } export async function getStaticProps() { const allPostsData = getSortedPostsData(); return { props: { allPostsData, }, }; }