Populate empty article slots in the grid with repeated content

Fill empty grid slots in the home page by repeating existing articles to ensure a full layout and improve visual consistency.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 23a4fedf-e948-4b7c-90a5-addc2a9da635
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/ls5p9ni
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic 2026-02-28 22:43:43 +00:00
parent daad124140
commit 66a0471447
2 changed files with 7 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@ -494,6 +494,13 @@ export default function Home() {
while (ai < shuffled.length) { while (ai < shuffled.length) {
items.push({ type: "article", article: shuffled[ai++] }); items.push({ type: "article", article: shuffled[ai++] });
} }
const totalSlots = Math.ceil(items.length / 4) * 4;
let fill = 0;
while (items.length < totalSlots && shuffled.length > 0) {
items.push({ type: "article", article: shuffled[fill % shuffled.length] });
fill++;
}
return items; return items;
}, [shuffled, widgets]); }, [shuffled, widgets]);