Skip to content

Commit

Permalink
2025
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeccati committed Jul 30, 2024
1 parent ac70d3d commit ea66e89
Show file tree
Hide file tree
Showing 2 changed files with 794 additions and 0 deletions.
59 changes: 59 additions & 0 deletions 2025/partners.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
---
(function (d, partners) {
var f = function (p, data) {
var tags, name;

if (!p.length) {
return;
}

p = p[0];
tags = p.getAttribute('data-tags') ? p.getAttribute('data-tags').split(/ +/) : '';
name = p.getAttribute('data-name') ? p.getAttribute('data-name') : '';

data.forEach(function(v) {
var hd, ha, hi;

if (v.tags) {
var c = v.tags.filter(function(n) {
return n === name || tags.indexOf(n) !== -1;
});

if (!c.length) {
return;
}
}

hi = d.createElement('IMG');
hi.setAttribute('src', {{ site.helper_baseurl | jsonify }} + '/img/partners/' + v.img);
hi.setAttribute('alt', v.name);

ha = d.createElement('A');
ha.setAttribute('href', v.url.replace(/%name%/g, encodeURIComponent(name)));
ha.setAttribute('target', '_blank');
ha.setAttribute('aria-title', v.name);
ha.setAttribute('role', 'button');
ha.setAttribute('rel', 'noopener noreferrer external');
ha.appendChild(hi);

hd = d.createElement('DIV');

if (p.classList.contains('grusp_community_partners')) {
hd.setAttribute('class', 'column column__community');
} else {
hd.setAttribute('class', 'column column__media');
}

hd.appendChild(ha);

p.appendChild(hd);
});
};

f(d.getElementsByClassName('grusp_media_partners'), partners.media, false);
f(d.getElementsByClassName('grusp_community_partners'), partners.community, true);
})(document, {
'media': {{ site.data.partners_2025.media | sort_natural: 'name' | jsonify }},
'community': {{ site.data.partners_2025.community | sort_natural: 'name' | jsonify }}
});
Loading

0 comments on commit ea66e89

Please sign in to comment.