diff --git a/src/app/[postSlug]/page.js b/src/app/[postSlug]/page.js index 19df3630..6b620991 100644 --- a/src/app/[postSlug]/page.js +++ b/src/app/[postSlug]/page.js @@ -1,23 +1,22 @@ -import React from 'react'; +import React from "react"; +import { MDXRemote } from "next-mdx-remote/rsc"; -import BlogHero from '@/components/BlogHero'; +import BlogHero from "@/components/BlogHero"; -import styles from './postSlug.module.css'; +import styles from "./postSlug.module.css"; +import { loadBlogPost } from "@/helpers/file-helpers"; + +async function BlogPost({ params }) { + const { frontmatter, content } = await loadBlogPost(params.postSlug); -function BlogPost() { return (
-

This is where the blog post will go!

-

- You will need to use MDX to render all of - the elements created from the blog post in this - spot. -

+
); diff --git a/src/app/page.js b/src/app/page.js index c0eb9457..f752cd72 100644 --- a/src/app/page.js +++ b/src/app/page.js @@ -1,23 +1,26 @@ -import React from 'react'; +import React from "react"; -import BlogSummaryCard from '@/components/BlogSummaryCard'; +import BlogSummaryCard from "@/components/BlogSummaryCard"; +import { getBlogPostList } from "@/helpers/file-helpers"; -import styles from './homepage.module.css'; +import styles from "./homepage.module.css"; + +async function Home() { + const blogPosts = await getBlogPostList(); -function Home() { return (
-

- Latest Content: -

+

Latest Content:

- {/* TODO: Iterate over the data read from the file system! */} - + {blogPosts.map((blog) => ( + + ))}
); }