Skip to content

Commit 41d0b58

Browse files
authored
Merge pull request #373 from CrowCpp/ghs-site
Added gh-sponsors to site
2 parents 90bd4b9 + e298c88 commit 41d0b58

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/overrides/home.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,20 @@ <h3 style="text-align:center;">The 1000 mile journey begins with a single step.
419419
}
420420
}
421421
}
422+
423+
let ghx = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/sponsors/CrowCpp");
424+
let ghy = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/count/CrowCpp");
425+
let ghsponsors = await ghx.json();
426+
ghsponsors = ghsponsors.sponsors;
427+
let ghx_count = await ghy.json();
428+
ghx_count = ghx_count.sponsors.count;
429+
430+
if (ghx_count > ghsponsors.length)
431+
{
432+
let priv_count = ghx_count - ghsponsors.length;
433+
ghsponsors.push({handle: priv_count = 1 ? "Private sponsor" : `${priv_count} Private sponsors`, avatar:null, profile:"https://github.com/CrowCpp"});
434+
}
435+
422436

423437
text += "<section style=\"text-align: center;\"><a href=\"https://opencollective.com/crow/contribute/sponsor-30717/checkout\"><h2>Sponsors</h2></a>";
424438
for(var i = 0; i < sponsors.length; i++){let item = sponsors[i]; text += makeCard(item.name, item.image, item.profile, 10);}
@@ -432,6 +446,9 @@ <h3 style="text-align:center;">The 1000 mile journey begins with a single step.
432446
text += "</section><br><section style=\"text-align: center;\"><a href=\"https://opencollective.com/crow/contribute/donation-30769/checkout\"><h2>Donations</h2></a>";
433447
for(var i = 0; i < donations.length; i++){let item = donations[i]; text += makeCard(item.name, item.image, item.profile, 3.5);}
434448

449+
text += "</section><br><section style=\"text-align: center;\"><a href=\"https://opencollective.com/crow/contribute/booster-30767/checkout\"><h2>GitHub Sponsors</h2></a>";
450+
for(var i = 0; i < ghsponsors.length; i++){let item = ghsponsors[i]; text += makeCard(item.handle, item.avatar, item.profile, 5);}
451+
435452
text += "</section><section style=\"text-align: center;\">";
436453
await getGHData();
437454
text += "</section>";

0 commit comments

Comments
 (0)