import Link from 'next/link'; import React from 'react'; import Layout from '../components/layout'; import Pages from '../public/pages.json'; import style from '../styles/home.module.css'; import prettyDatePrint from '../util/pretty-date'; import { getPostsMeta, PostMeta } from '../util/slug'; function HomePage(props: {postsMeta: PostMeta[]}) { props.postsMeta.sort((x, y) => { return (x.title).localeCompare(y.title) }); return (
Welcome!
{ Pages.map(obj => { return {obj.title} }) }
{props.postsMeta?.map((post: any) => { return })}
Posts Posted
{post.title} {prettyDatePrint(new Date(post.created_at))}
) } export async function getServerSideProps() { return { props: { postsMeta: getPostsMeta() } }; } export default HomePage;