import { GetServerSideProps } from "next"; import { MainLayout } from "../../layouts/MainLayout"; import { Post, getAllBlogsFrontMatter } from "../../utils/markdown"; import { FrontMatter } from "../../types/types"; import Link from "next/link"; import { formatDate } from "../../utils/general"; import { BasicArticleProps } from "../../components/PostHeader"; const BlogCard = ({ blog, slug, }: { blog: BasicArticleProps; slug: string; }) => { return (
{formatDate(blog.date)}

{blog.title}

{blog.description}

); }; const Blog = ({ posts }: { posts: Post[] }) => { return (

Blog

{posts.map((post, index) => ( ))}
); }; export const getServerSideProps: GetServerSideProps = async () => { const posts = getAllBlogsFrontMatter(); return { props: { posts, }, }; }; export default Blog;