www/pages/index.tsx

30 lines
977 B
TypeScript
Raw Normal View History

2021-12-07 22:38:31 -05:00
import React from 'react';
import Layout from '../components/layout';
2022-04-27 21:55:18 -04:00
import QuickLinks from '../components/quick-links';
2022-04-28 12:37:12 -04:00
import RecentNotes from '../components/recent-notes';
2022-04-27 21:55:18 -04:00
import RecentPosts from '../components/recent-posts';
2022-04-28 12:37:12 -04:00
import { getNotesMeta, getPostsMeta, NoteMeta, PostMeta } from '../util/slug';
2021-12-07 22:38:31 -05:00
2022-04-28 12:37:12 -04:00
function HomePage({ postsMeta, notesMeta }: { postsMeta: PostMeta[], notesMeta: NoteMeta[] }) {
2021-12-07 22:38:31 -05:00
return (
<Layout name='' title='PaulW.XYZ'>
<section className='block'>
2022-04-27 21:55:18 -04:00
<QuickLinks />
2021-12-07 22:38:31 -05:00
</section>
<section className='block'>
2022-04-27 21:55:18 -04:00
<RecentPosts postsMeta={postsMeta} />
</section>
2022-04-28 12:37:12 -04:00
<section className='block'>
<RecentNotes notesMeta={notesMeta} />
</section>
2021-12-07 22:38:31 -05:00
</Layout>
)
}
2022-04-27 06:39:10 -04:00
export async function getStaticProps() {
2022-04-27 04:03:21 -04:00
return {
2022-04-28 12:37:12 -04:00
props: { postsMeta: getPostsMeta(), notesMeta: getNotesMeta() }
2022-04-27 04:03:21 -04:00
};
}
export default HomePage;