summary refs log tree commit diff
path: root/app/posts/page.tsx
diff options
context:
space:
mode:
authorAshelyn Rose <git@tempest.dev>2023-05-08 19:25:46 -0600
committerAshelyn Rose <git@tempest.dev>2023-05-08 19:29:19 -0600
commitd89d92d3936683f4212186cef517c7930dd5b33a (patch)
treecba24caddd1dc5f950b5e42eb333261f0c13dca5 /app/posts/page.tsx
parent6cddfdf8fe9bccc291ee8625d42cb42fd4ce2134 (diff)
add markdown rendering, copy in old posts
Diffstat (limited to 'app/posts/page.tsx')
-rw-r--r--app/posts/page.tsx21
1 files changed, 18 insertions, 3 deletions
diff --git a/app/posts/page.tsx b/app/posts/page.tsx
index 34f0e7f..e713259 100644
--- a/app/posts/page.tsx
+++ b/app/posts/page.tsx
@@ -1,11 +1,26 @@
-export default function Posts() {
+import InfoBar from "~/components/InfoBar"
+import { Post, getPostSlugs, loadSinglePage } from "~/utils/post"
+
+export default async function Posts() {
+  const slugs = await getPostSlugs()
+  const posts = await Promise.all(slugs.map(loadSinglePage))
+
+  const sortedPosts = posts.sort((a: Post, b: Post) => b.date.valueOf() - a.date.valueOf())
+
   return (
     <>
       <h1 className="pageTitle">
         Posts
       </h1>
-      <main className="mainColumn">
-        <p>This will have posts here eventually we promise</p>
+      <main>
+        {sortedPosts.map((post: Post) => (
+          <div className="mainColumn">
+            <InfoBar authorName={post.author} publishedDate={post.date} />
+            <h2>{post.title}</h2>
+            <p>{post.subtitle}</p>
+            <a href={`/posts/${post.slug}`}>Read Post =&gt;</a>
+          </div>
+        ))}
       </main>
     </>
   )