diff --git a/src/pages/index.js b/src/pages/index.js index f17d4d9..94ddd4e 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,57 +1,11 @@ /* eslint-disable func-style */ import React from "react"; -import Head from "next/head"; -import Layout, { siteTitle } from "../components/layout"; -import utilStyles from "../styles/utils.module.css"; -import { getSortedPostsData } from "../lib/posts"; -import Link from "next/link"; -import Date from "../components/date"; +import Layout from "../components/layout"; -export default function Home({ allPostsData }) { +export default function Home({ }) { return ( - - {siteTitle} - -
-

- A sample blog built with Next.js and deployed to AWS lambda as a - single function / endpoint via the Next.js server{" "} - output target. -

-

- Learn more at:{" "} - FormidableLabs/nextjs-serverless-demo -

-
-
-

Blog

- -
+ hi
); } - -export async function getStaticProps() { - const allPostsData = await getSortedPostsData(); - return { - props: { - allPostsData - } - }; -} diff --git a/src/pages/posts/[...id].js b/src/pages/posts/[...id].js new file mode 100644 index 0000000..3feb838 --- /dev/null +++ b/src/pages/posts/[...id].js @@ -0,0 +1,15 @@ +/* eslint-disable func-style */ +import React from "react"; +import Layout from "../../components/layout"; + +export default function Post() { + return ( + + hi + + ); +} + +Post.getInitialProps = () => { + return Promise.resolve({}); +} \ No newline at end of file diff --git a/src/pages/posts/[id].js b/src/pages/posts/[id].js deleted file mode 100644 index cc50189..0000000 --- a/src/pages/posts/[id].js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable func-style */ -import React from "react"; -import Layout from "../../components/layout"; -import { getAllPostIds, getPostData } from "../../lib/posts"; -import Head from "next/head"; -import Date from "../../components/date"; -import utilStyles from "../../styles/utils.module.css"; - -export default function Post({ postData }) { - return ( - - - {postData.title} - -
-

{postData.title}

-
- -
-
-
-
- ); -} - -export async function getStaticPaths() { - const paths = await getAllPostIds(); - return { - paths, - fallback: false - }; -} - -export async function getStaticProps({ params }) { - const postData = await getPostData(params.id); - return { - props: { - postData - } - }; -}