From 537205ecb298248eb70439d3c8d1f57914d7fddb Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 22 Dec 2024 15:32:37 +0000 Subject: [PATCH] Doc: Allow specifying alt attribute for sponsor images --- README.md | 2 +- packages/tools/sponsors.json | 3 ++- packages/tools/update-readme-sponsors.ts | 3 ++- packages/tools/utils/loadSponsors.ts | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d1dbd4ea8..f212d4069 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Please see the [donation page](https://github.com/laurent22/joplin/blob/dev/read # Sponsors - + EduBirdie * * * diff --git a/packages/tools/sponsors.json b/packages/tools/sponsors.json index 47603693e..9bddf0c3c 100644 --- a/packages/tools/sponsors.json +++ b/packages/tools/sponsors.json @@ -111,7 +111,8 @@ { "url": "https://ca.edubirdie.com/", "title": "Achieve academic success with Edubirdie — your trusted partner for expert writing assistance and resources!", - "imageName": "Edubirdie.png" + "imageName": "Edubirdie.png", + "alt": "EduBirdie" } ], "orgsOld": [ diff --git a/packages/tools/update-readme-sponsors.ts b/packages/tools/update-readme-sponsors.ts index e066451f5..a7ebeb4ae 100644 --- a/packages/tools/update-readme-sponsors.ts +++ b/packages/tools/update-readme-sponsors.ts @@ -51,7 +51,8 @@ async function createOrgSponsorTable(sponsors: OrgSponsor[]): Promise { const output: string[] = []; for (const sponsor of sponsors) { - output.push(``); + const altHtml = sponsor.alt ? ` alt="${escapeHtml(sponsor.alt)}"` : ''; + output.push(``); } return output.join(' '); diff --git a/packages/tools/utils/loadSponsors.ts b/packages/tools/utils/loadSponsors.ts index 8073d4265..22521e64c 100644 --- a/packages/tools/utils/loadSponsors.ts +++ b/packages/tools/utils/loadSponsors.ts @@ -18,6 +18,7 @@ export interface OrgSponsor { urlWebsite?: string; title: string; imageName: string; + alt?: string; } export const loadSponsors = async (): Promise => {