11import mdxComponents from '@/components/mdxComponents' ;
22import { EditDialogStyles } from '@/styles/EditDialogStyles.module.css' ;
33import { postMeta } from '@/styles/PostMeta.module.css' ;
4+ import { format } from 'date-fns' ;
45import { IoLogoGithub } from 'react-icons/io' ;
56import type { PageProps } from 'waku/router' ;
67import { unstable_notFound as notFound } from 'waku/router/server' ;
@@ -26,6 +27,7 @@ export default async function BlogPost(props: BlogPostPageProps) {
2627 const { default : MDXContent } = post ;
2728 const editURL = `https://github.com/wesbos/wesbos/tree/master/${ post . filePath } ` ;
2829 const image = post . images ?. [ 0 ] ;
30+ const postDate = new Date ( post . frontmatter . date ) ;
2931
3032 return (
3133 < >
@@ -34,7 +36,7 @@ export default async function BlogPost(props: BlogPostPageProps) {
3436 < div >
3537 < H > { post . frontmatter . title } </ H >
3638 < div className = { postMeta } >
37- < time dateTime = { post . frontmatter . date } > { post . frontmatter . date } </ time >
39+ < time dateTime = { postDate . toISOString ( ) } > { format ( postDate , 'MMMM d, yyyy' ) } </ time >
3840
3941 < span > { post . frontmatter . category . join ( ', ' ) } </ span >
4042 < a rel = "noopener noreferrer" target = "_blank" href = { editURL } >
@@ -52,7 +54,7 @@ export default async function BlogPost(props: BlogPostPageProps) {
5254 </ a >
5355 </ p >
5456 </ div >
55- < ContentNav prev = { prev } next = { next } />
57+ < ContentNav { ... ( prev ? { prev } : { } ) } { ... ( next ? { next } : { } ) } />
5658 </ >
5759 ) ;
5860}
0 commit comments