diff --git a/apps/website/app/[locale]/blog/[slug]/page.tsx b/apps/website/app/[locale]/blog/[slug]/page.tsx index 0f4345f..3984cdb 100644 --- a/apps/website/app/[locale]/blog/[slug]/page.tsx +++ b/apps/website/app/[locale]/blog/[slug]/page.tsx @@ -167,17 +167,44 @@ export default async function BlogPostPage({ params }: Props) {
{post.primary_author?.profile_image && (
- {post.primary_author.name} + {post.primary_author.twitter ? ( + + {post.primary_author.name} + + ) : ( + {post.primary_author.name} + )}
)}

- {post.primary_author?.name || "Unknown Author"} + {post.primary_author?.twitter ? ( + + {post.primary_author.name || "Unknown Author"} + + ) : ( + post.primary_author?.name || "Unknown Author" + )}

{formattedDate} • {post.reading_time} min read diff --git a/apps/website/app/[locale]/blog/components/BlogPostCard.tsx b/apps/website/app/[locale]/blog/components/BlogPostCard.tsx new file mode 100644 index 0000000..9b38222 --- /dev/null +++ b/apps/website/app/[locale]/blog/components/BlogPostCard.tsx @@ -0,0 +1,94 @@ +"use client"; + +import type { Post } from "@/lib/ghost"; +import Image from "next/image"; +import Link from "next/link"; + +interface BlogPostCardProps { + post: Post; + locale: string; +} + +export function BlogPostCard({ post, locale }: BlogPostCardProps) { + const formattedDate = new Date(post.published_at).toLocaleDateString(locale, { + year: "numeric", + month: "long", + day: "numeric", + }); + + return ( + +

+ {post.feature_image && ( +
+ {post.title} +
+ )} +
+

+ {post.title} +

+

+ {post.custom_excerpt || post.excerpt} +

+
+
+ {post.primary_author?.profile_image && ( +
+ {post.primary_author.twitter ? ( + + {post.primary_author.name} + + ) : ( + {post.primary_author.name} + )} +
+ )} + {post.primary_author?.twitter ? ( + + {post.primary_author.name || "Unknown Author"} + + ) : ( + {post.primary_author?.name || "Unknown Author"} + )} +
+ in + {post.primary_tag?.name || "General"} + + {post.reading_time} min read + + {formattedDate} +
+
+
+ + ); +} diff --git a/apps/website/app/[locale]/blog/page.tsx b/apps/website/app/[locale]/blog/page.tsx index ab7328e..2481da7 100644 --- a/apps/website/app/[locale]/blog/page.tsx +++ b/apps/website/app/[locale]/blog/page.tsx @@ -102,7 +102,7 @@ function BlogPostCard({ post, locale }: { post: Post; locale: string }) { className="group block hover:bg-muted p-4 rounded-lg" >
- {post.feature_image && ( + {post.feature_image ? (
+ ) : ( +
+ Default Image +
)}

@@ -123,15 +132,42 @@ function BlogPostCard({ post, locale }: { post: Post; locale: string }) {
{post.primary_author?.profile_image && (
- {post.primary_author.name} + {post.primary_author.twitter ? ( + + {post.primary_author.name} + + ) : ( + {post.primary_author.name} + )}
)} - {post.primary_author?.name || "Unknown Author"} + {post.primary_author?.twitter ? ( + + {post.primary_author.name || "Unknown Author"} + + ) : ( + {post.primary_author?.name || "Unknown Author"} + )}
in {post.primary_tag?.name || "General"} diff --git a/apps/website/lib/ghost.ts b/apps/website/lib/ghost.ts index 35eca37..5bbb16c 100644 --- a/apps/website/lib/ghost.ts +++ b/apps/website/lib/ghost.ts @@ -66,6 +66,7 @@ export interface Post { slug: string; profile_image: string | null; bio: string | null; + twitter: string | null; }; authors?: Array<{ id: string; diff --git a/apps/website/public/default.jpg b/apps/website/public/default.jpg new file mode 100644 index 0000000..7133496 Binary files /dev/null and b/apps/website/public/default.jpg differ