Restore original ad placement strategy within the blog layout
Revert ad placement logic to original configuration, inserting ads into specific rows (1, 3, 5, 7) and columns (3, 1, 2, 0) within the item grid. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 670bb9b9-fca8-4896-b815-85b176b197c3 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
6b2e5767fd
commit
7eca616874
@ -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]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user