diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 4d0a2d3..d54cf74 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -490,6 +490,17 @@ export default function Home() { } } + const totalRows = items.length / 4; + const adRows = [1, 3, 5, 7]; + const adCols = [3, 1, 2, 0]; + adRows.forEach((row, i) => { + if (row < totalRows) { + const idx = row * 4 + adCols[i % adCols.length]; + if (items[idx] && items[idx].type === "article") { + items[idx] = { type: "ad", key: `ad-${i}` }; + } + } + }); return items; }, [shuffled, widgets]);