diff --git a/pages/index.tsx b/pages/index.tsx new file mode 100644 index 0000000..e83592a --- /dev/null +++ b/pages/index.tsx @@ -0,0 +1,32 @@ +import React from "react"; +import { InferGetStaticPropsType } from "next"; +import { Blocks } from "../components/blocks-renderer"; +import { useTina } from "tinacms/dist/react"; +import { Layout } from "../components/layout"; +import { client } from "../tina/__generated__/client"; + +export default function HomePage( + props: InferGetStaticPropsType +) { + const { data } = useTina(props); + + return ( + + + + ); +} + +export const getStaticProps = async () => { + const tinaProps = await client.queries.contentQuery({ + relativePath: `home.md`, + }); + const props = { + ...tinaProps, + enableVisualEditing: process.env.VERCEL_ENV === "preview", + }; + return { + props: JSON.parse(JSON.stringify(props)) as typeof props, + }; +}; +