forked from karanpratapsingh/portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
38 lines (32 loc) · 1002 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { PageSEO } from '@/components/SEO';
import siteMetadata from '@/data/siteMetadata';
import { getFileBySlug } from '@/lib/mdx';
import { GetStaticProps, InferGetStaticPropsType } from 'next';
import dynamic from 'next/dynamic';
import { AuthorFrontMatter } from 'types/AuthorFrontMatter';
// TODO: Direct share functionality.
// TODO: Switch geist-ui with something simple.
// @ts-ignore
export const getStaticProps: GetStaticProps<{
author: AuthorFrontMatter;
}> = async () => {
const authorDetails = await getFileBySlug<AuthorFrontMatter>('authors', [
'default',
]);
const { frontMatter: author } = authorDetails;
return { props: { author } };
};
const Banner = dynamic(import('@/components/Banner'));
export default function Home({
author,
}: InferGetStaticPropsType<typeof getStaticProps>) {
return (
<>
<PageSEO
title={siteMetadata.title}
description={siteMetadata.description}
/>
<Banner frontMatter={author} />
</>
);
}