Skip to content

Commit b68c0fc

Browse files
chore(sponsors): disable utm links generation for slotozilla-deutschland; (axios#198)
* 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(sponsors): disable utm links generation for `slotozilla-deutschland`;
1 parent b343a4b commit b68c0fc

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Diff for: data/sponsors.json

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
"Free Trial": "https://route4me.com/platform/marketplace/pricing",
6565
"Contact": "https://route4me.com/contact"
6666
}
67+
},
68+
"slotozilla-deutschland" : {
69+
"autoUTMLinks": false
6770
}
6871
}
6972
}

Diff for: scripts/updateData.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ const ensurePath = async (path) => {
4444
}
4545
}
4646

47-
const makeUTMURL = (url, params) => {
47+
const makeUTMURL = (url, params, bypass) => {
4848
const urlObj = new URL(url);
4949

5050
const {searchParams} = urlObj;
5151

52-
if (!searchParams.utm_source && !searchParams.utm_campaign) {
52+
if (!bypass && !searchParams.utm_source && !searchParams.utm_campaign) {
5353
Object.entries({
5454
utm_source: 'axios',
5555
utm_medium: 'sponsorlist',
@@ -232,6 +232,10 @@ const processSponsors = async (sponsorsData, sponsorsConfig = './data/sponsors.j
232232
tooltip += `<div class="description">${description}</div>`;
233233
}
234234

235+
sponsor.targetLink = website || sponsor.twitter || sponsor.github || sponsor.profile;
236+
237+
const autoUTMLinks = sponsor.autoUTMLinks !== false; // hotfix
238+
235239
const linksArray = Object.entries(links || {});
236240

237241
if (linksArray.length) {
@@ -240,7 +244,7 @@ const processSponsors = async (sponsorsData, sponsorsConfig = './data/sponsors.j
240244
href: entry
241245
} : entry || {};
242246

243-
return `<a href="${makeUTMURL(href)}">${html.escape(text)}</a>`;
247+
return `<a href="${makeUTMURL(href, undefined, !autoUTMLinks)}">${html.escape(text)}</a>`;
244248
}).join('');
245249

246250
tooltip += `<div class="links">${rendered}</divclass>`
@@ -251,18 +255,16 @@ const processSponsors = async (sponsorsData, sponsorsConfig = './data/sponsors.j
251255

252256
if(!link) return;
253257

254-
return `<a href="${makeUTMURL(link)}"><img class="icon" src="/assets/icons/social/${icon}"/></a>`;
258+
return `<a href="${makeUTMURL(link, undefined, !autoUTMLinks)}"><img class="icon" src="/assets/icons/social/${icon}"/></a>`;
255259
}).filter(Boolean).join('');
256260

257261
tooltip += `<div class="social">${icons}</div>`
258262

259263
sponsor.tooltip = tooltip;
260264

261-
sponsor.targetLink = website || sponsor.twitter || sponsor.github || sponsor.profile;
262-
263265
const parsed = parseURL(sponsor.targetLink);
264266

265-
sponsor.utmLink = !sponsor.utmLink && parsed && makeUTMURL(sponsor.targetLink);
267+
sponsor.utmLink = !sponsor.utmLink && parsed && makeUTMURL(sponsor.targetLink, undefined, !autoUTMLinks);
266268
}));
267269

268270
const sortedSponsors = {};

0 commit comments

Comments
 (0)