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"; export interface BasicBlogProps extends FrontMatter { title: string; description: string; date: string; author: string; authorLink: string; } const BlogCard = ({ blog, slug }: { blog: BasicBlogProps; 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;