@@ -1,5 +1,5 @@
11import { useRouter } from 'next/router'
2−import { getPostBySlug, getAllPosts, getNextPost, getPreviousPost } from '../../lib/lib'
2+import { getPostBySlug, getAllPosts, getNextPost, getPreviousPost, formatDate } from '../../lib/lib'
33import Head from 'next/head'
44import Link from 'next/link'
55import ErrorPage from '../404'
@@ -7,6 +7,7 @@ import Container from '../../components/Container'
77import Markdown from '../../components/Markdown'
88import Header from '../../components/Header'
99import Footer from '../../components/Footer'
10+import BackgroundImage from '../../components/BackgroundImage'
1011import SingleColumn from '../../components/SingleColumn'
1112
1213import {
@@ -23,15 +24,52 @@ export default function Post({ post, nextPost, previousPost }) {
2324 <Container>
2425 <SingleColumn>
2526 <Header />
26− <section className="flex flex-col layout-wide pt-48">
27+ <section className="flex flex-col layout-wide pt-24">
2728 <h1>{post.title}</h1>
29+
30+ {
31+ post.extra.author ? <div className='type-ui text-gray mt-4'>{post.extra.author}</div> : null
32+ }
33+ {
34+ post.extra.ship ? <div className='type-ui text-gray font-mono'>{post.extra.ship}</div> : null
35+ }
36+
37+ <div className='type-ui text-gray mt-16'>{formatDate(new Date(post.date))}</div>
38+
2839 </section>
29− <article className="flex items-center pt-48">
30− <Markdown post={post} />
40+ <article className="flex justify-center pt-12">
41+ <Markdown post={post} />
3142 </article>
32− <section className="layout-narrow pt-48">
33− <Link href={nextPost.slug}>{nextPost.title}</Link>
34− <Link href={previousPost.slug}>{previousPost.title}</Link>
43+ <section className="layout-wide pt-24 flex">
44+
45+ {
46+ previousPost === null
47+ ? <div className={`w-1/2 mr-4`} />
48+ : <div className={`cursor-pointer w-1/2 mr-4`} key={previousPost.slug}>
49+ <Link href={'/blog/' + previousPost.slug} key={`post-${previousPost.slug}`}>
50+ <div>
51+ <h3>Previous Post</h3>
52+ <BackgroundImage className="w-full h-80 rounded-lg" src={previousPost.extra.image || ''} />
53+ <p className='text-black mt-2'>{previousPost.title || ''}</p>
54+ <p className='text-gray'>{formatDate(new Date(previousPost.date))}</p>
55+ </div>
56+ </Link>
57+ </div>
58+ }
59+ {
60+ nextPost === null
61+ ? <div className={`w-1/2 ml-4`} />
62+ : <div className={`cursor-pointer w-1/2 ml-4`}>
63+ <Link href={'/blog/' + nextPost.slug} key={`post-${nextPost.slug}`}>
64+ <div>
65+ <h3>Next Post</h3>
66+ <BackgroundImage className="w-full h-80 rounded-lg" src={nextPost.extra.image || ''} />
67+ <p className='text-black mt-2'>{nextPost.title || ''}</p>
68+ <p className='text-gray'>{formatDate(new Date(nextPost.date))}</p>
69+ </div>
70+ </Link>
71+ </div>
72+ }
3573 </section>
3674 </SingleColumn>
3775 <Footer />
@@ -48,7 +86,7 @@ export async function getStaticProps({ params }) {
4886 'date',
4987 'description',
5088 'extra',
51− ], 'blog')
89+ ], 'blog') || null
5290
5391 const previousPost = getPreviousPost(params.slug, [
5492 'title',
@@ -56,7 +94,7 @@ export async function getStaticProps({ params }) {
5694 'date',
5795 'description',
5896 'extra',
59− ], 'blog')
97+ ], 'blog') || null
6098
6199 const post = getPostBySlug(params.slug, [
62100 'title',