From 301bb9277e978558c99f8fbb76a996937d366c92 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 28 Feb 2026 18:03:05 +0000 Subject: [PATCH] Add an advertisement card to the blog post category page Integrate `ArticleCardAd` component into the category page's article grid to display an advertisement between posts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 413891e8-d784-4bea-b9f5-91a5a68316b4 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 280e79de-a056-4133-85e8-89539a552ee8 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/413891e8-d784-4bea-b9f5-91a5a68316b4/igVW4lQ Replit-Helium-Checkpoint-Created: true --- client/src/pages/category.tsx | 85 +++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/client/src/pages/category.tsx b/client/src/pages/category.tsx index b8a99c5..ff73de4 100644 --- a/client/src/pages/category.tsx +++ b/client/src/pages/category.tsx @@ -8,6 +8,7 @@ import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; import Header from "@/components/header"; import Footer from "@/components/footer"; +import { ArticleCardAd } from "@/components/adsense"; export default function CategoryPage() { const { category } = useParams<{ category: string }>(); @@ -46,47 +47,53 @@ export default function CategoryPage() { ) : articles && articles.length > 0 ? (
- {articles.map((article) => ( - -
-
-
- {article.title} + {articles.flatMap((article, index) => { + const items = [ + +
+
+
+ {article.title} +
-
-
-
- {article.author} - · - {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} +
+
+ {article.author} + · + {format(new Date(article.publishedAt), "d. MMMM yyyy", { locale: de })} +
+

+ {article.title} +

+

+ {article.excerpt} +

+
+ + + {article.views.toLocaleString()} + + +
-

- {article.title} -

-

- {article.excerpt} -

-
- - - {article.views.toLocaleString()} - - -
-
-
- - ))} + + , + ]; + if (index === 2) { + items.push(); + } + return items; + })}
) : (