import { format, parseISO } from 'date-fns'; import { GetStaticProps } from 'next'; import Link from 'next/link'; import React from 'react'; import Layout from '../components/Layout'; import { getAllPosts } from '../lib/api'; import { PostType } from '../types/post'; type IndexProps = { posts: PostType[]; }; export const Index = ({ posts }: IndexProps): JSX.Element => { return (

Робототехнический фестиваль RobotTop

RobotTop – это робототехнические соревнования, в которых могут принять участие молодые любители робототехники, объединившись в команды.

{posts.map((post) => (

{format(parseISO(post.date), 'MMMM dd, yyyy')}

{post.title}

{post.description}

Подробнее...

))}
); }; export const getStaticProps: GetStaticProps = async () => { const posts = getAllPosts(['date', 'description', 'slug', 'title']); return { props: { posts }, }; }; export default Index;