www/pages/index.tsx

24 lines
776 B
TypeScript
Raw Normal View History

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