Skip to content

Commit

Permalink
Merge pull request #373 from CrowCpp/ghs-site
Browse files Browse the repository at this point in the history
Added gh-sponsors to site
  • Loading branch information
The-EDev authored Mar 24, 2022
2 parents 90bd4b9 + e298c88 commit 41d0b58
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,20 @@ <h3 style="text-align:center;">The 1000 mile journey begins with a single step.
}
}
}

let ghx = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/sponsors/CrowCpp");
let ghy = await fetch("https://gh-sponsors-dsdpxxx9d-filiptronicek.vercel.app/count/CrowCpp");
let ghsponsors = await ghx.json();
ghsponsors = ghsponsors.sponsors;
let ghx_count = await ghy.json();
ghx_count = ghx_count.sponsors.count;

if (ghx_count > ghsponsors.length)
{
let priv_count = ghx_count - ghsponsors.length;
ghsponsors.push({handle: priv_count = 1 ? "Private sponsor" : `${priv_count} Private sponsors`, avatar:null, profile:"https://github.com/CrowCpp"});
}


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

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

text += "</section><section style=\"text-align: center;\">";
await getGHData();
text += "</section>";
Expand Down

0 comments on commit 41d0b58

Please sign in to comment.