Skip to content

Commit 5e8534c

Browse files
authoredOct 31, 2024
chore(sponsors): add 'become a sponsor' link to empty cells in the Readme sponsor block; (axios#214)
* feat: add sponsor list generator; * feat: added deploy action; * fix: fixed layout; * fix: use utm links inside tooltips; * fix(CI): set engine version; * chore: reverted the start button title change; * fix: add the ability to retry the request to get a list of sponsors; * chore: change sponsors config & fix sponsor card layout; * chore: hide 'incognito' sponsor from the list of sponsors; * chore: add Route4Me sponsor; * chore: fixed resolution of utm link for manually added sponsors; * chore: fixed sponsors' tiers resolving; * chore: draft; * chore(sponsors): disable utm links generation for `slotozilla-deutschland`; * chore(draft): Improve sponsors list generator; * chore(draft): fix origin preset; * chore(draft): delete generated icon; * chore(draft): add check to ensure dir exists; * chore(draft): add check to ensure dir exists; * chore(draft): activate GitHub data pulling; * chore(draft): fix crown chevron styling; * chore(draft): reduce logo min-width; * chore(draft): add missed `route4me` light logo; * chore(draft): add a title for readme sponsor block; * chore(draft): fix description resolving; * chore(draft): add utm links for sponsors rendered to markdown; * chore(draft): respect autoUTMLinks for utm links generation; * chore(draft): set user theme timeout to 24 hours; * chore(draft): set utm link for markdown output; * chore(draft): add sponsors' logos; * chore(draft): fix sponsor.json; * chore(draft): fix sponsor.json; * chore(draft): add principal logo; * chore(draft): add a hotfix for svg logos; * chore(draft): use image metadata instead of file extension to determine image format; * chore(draft): add Stytch & Descope links; * chore(draft): fix utm link generator to respect sponsor's params; * chore(draft): add page active link rendering; * chore(draft): notes block refactoring; * chore(draft): remove graphql packages; * chore(sponsors): add website link for buzzoid.com; * chore(sponsors): remove Route4me from the list; * chore(sponsors): Fixed relative URLs for dark theme logos in the Readme sponsor generator; * chore(sponsors): add 'become a sponsor' link to empty cells in the Readme sponsor block;
1 parent 5777057 commit 5e8534c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed
 

‎scripts/updateData.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,25 @@ Handlebars.registerHelper("short", function (...args) {
4646

4747
Handlebars.registerHelper("table", function(...args) {
4848
const options = args.pop();
49-
const [context, columns = 1, separate] = args;
49+
const [context, columns = 1, separate, fill] = args;
5050

5151
const rows = [[]];
5252
let arr = rows[0];
5353

54-
const last = context.length - 1;
55-
5654
const width = 100 / columns;
5755

56+
if (fill) {
57+
for (let i = columns - context.length % columns; i > 0; i--) {
58+
context.push(null);
59+
}
60+
}
61+
62+
const last = context.length - 1;
63+
5864
context.forEach((that, i) => {
5965
arr.push(`<td align="center" width="${width}%">${options.fn(that)}</td>`);
60-
if (i !== last && arr.length === columns) {
61-
rows.push(arr = []);
62-
}
66+
67+
last !== i && arr.length === columns && rows.push(arr = []);
6368
});
6469

6570
return new Handlebars
@@ -307,6 +312,7 @@ const renderMarkdownSponsors = async (sponsors) => {
307312
caption,
308313
cells,
309314
separate,
315+
fill: true,
310316
sponsors: sponsors.map(sponsor => {
311317
const [w = 0, h = 0] = sponsor.image ? fitInRect(sponsor.imageWidth, sponsor.imageHeight, width, height) : [];
312318

‎templates/sponsors.hbs

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<br>
55
</h3>
66

7-
{{#table sponsors cells separate}}
7+
{{#table sponsors cells separate fill}}
8+
{{#if this}}
89
{{#if displayName}}
910
{{#if image}}
1011
<a href="{{targetLink}}" style="padding: 10px; display: inline-block">
@@ -27,5 +28,8 @@
2728
{{else}}
2829
- {{displayName}}
2930
{{/if}}
31+
{{else}}
32+
<a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
33+
{{/if}}
3034
{{/table}}
3135
{{/if}}

0 commit comments

Comments
 (0)
Please sign in to comment.