From a5f7c95f13544ede8bd84935988c89d1dc235d89 Mon Sep 17 00:00:00 2001
From: Felix <188768+fb55@users.noreply.github.com>
Date: Fri, 5 Jan 2024 16:51:15 +0000
Subject: [PATCH] chore(sponsors): Size tiers differently
---
Readme.md | 22 +++++++++++-----------
scripts/fetch-sponsors.mts | 36 +++++++++++++++++++++++-------------
2 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/Readme.md b/Readme.md
index f7dc2b73ca..1f780a965c 100644
--- a/Readme.md
+++ b/Readme.md
@@ -197,31 +197,31 @@ development and support.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -234,10 +234,10 @@ support for Cheerio and help us maintain and improve this open source project.
-
+
-
+
diff --git a/scripts/fetch-sponsors.mts b/scripts/fetch-sponsors.mts
index 036bf8a69f..d5c944208a 100644
--- a/scripts/fetch-sponsors.mts
+++ b/scripts/fetch-sponsors.mts
@@ -321,11 +321,18 @@ for (const tier of Object.values(tierSponsors)) {
// Write sponsors.json
await fs.writeFile(JSON_PATH, JSON.stringify(tierSponsors, null, 2), 'utf8');
-// Merge professionals into backers for now
+// Prepend professionals to backers for now
tierSponsors.backer.unshift(...tierSponsors.professional);
let readme = await fs.readFile(README_PATH, 'utf8');
+const TIER_IMAGE_SIZES: Record = {
+ headliner: 128,
+ sponsor: 64,
+ professional: 64,
+ backer: 48,
+};
+
for (let sectionStartIndex = 0; ; ) {
sectionStartIndex = readme.indexOf(
SECTION_START_BEGINNING,
@@ -351,18 +358,21 @@ for (let sectionStartIndex = 0; ; ) {
readme = `${readme.slice(0, sectionContentStart)}\n\n${tierSponsors[
sectionName
]
- .map(
- (s: Sponsor) =>
- // Display each sponsor's image in the README.
- `
-
- `,
- )
+ .map((s: Sponsor) => {
+ const size = TIER_IMAGE_SIZES[s.tier ?? sectionName];
+ // Display each sponsor's image in the README.
+ return `
+
+ `;
+ })
.join('\n')}\n\n${readme.slice(sectionEndIndex)}`;
}