forked from bevyengine/bevy-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindividual-sponsors.html
103 lines (93 loc) · 4.01 KB
/
individual-sponsors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<h2 class="donate-header-padding">Sponsors of Individuals</h2>
<div class="credits-text">
These people and organizations sponsor individual members of Bevy leadership using platforms like GitHub sponsors. This is the "old" way to support Bevy. The Bevy Foundation does not have access to these funds and these sponsorships do not contribute to the totals displayed at the top of the Donate page. We will be deprecating this section soon!
</div>
<div class="sponsors-section">
<!-- Note: this logic is duplicated into donate.html ... it _must_ be kept in sync -->
{% set sponsors = load_data(path="content/donate/individual-sponsors.toml") %}
{% set tiers = load_data(path="content/donate/tiers.toml") %}
{% for tier in tiers.tier | reverse %}
{% if not tier.reward_logo and not tier.reward_link and not tier.reward_name %}
{% continue %}
{% endif %}
{% set next_tier_index = tiers.tier | length - loop.index0 %}
{% set next_tier = tiers.tier | nth(n=next_tier_index) %}
{% set_global sponsors_in_tier = [] %}
{% if sponsors.sponsor %}
{% for sponsor in sponsors.sponsor %}
{% if sponsor.past %}
{% continue %}
{% endif %}
<!-- Note: this "sponsor filtering logic" _must_ be kept in sync with the logic in donate.html -->
<!-- If we can find a way to reuse this logic in Zola, we absolutely should! -->
{% if sponsor.amount >= tier.amount %}
{% if next_tier and sponsor.amount >= next_tier.amount %}
{% continue %}
{% endif %}
{% set_global sponsors_in_tier = sponsors_in_tier | concat(with=sponsor) %}
{% endif %}
{% endfor %}
{% endif %}
{% if sponsors_in_tier | length == 0 %}
{% continue %}
{% endif %}
<div class="sponsors sponsors--{{ tier.name | replace(from=" ", to="_") | lower }}">
<h2 class="sponsors__title">{{ tier.name }}</h2>
<h3 class="sponsors__amount">${{ tier.amount }} / month</h3>
<div class="sponsors__content">
{% for sponsor in sponsors_in_tier %}
{% if tier.reward_logo %}
{% set_global logo_height = tier.logo_height %}
{% if sponsor.square_logo %}
{% set_global logo_height = logo_height * 1.666 %}
{% endif %}
{% if sponsor.logo_scale %}
{% set_global logo_height = logo_height * sponsor.logo_scale %}
{% endif %}
<a class="sponsors__link" href="{{ sponsor.link }}">
<img
class="sponsors__logo"
height="{{ logo_height }}"
{% if sponsor.style %}
style="{{ sponsor.style }}"
{% endif %}
src="/assets/sponsors/{{ sponsor.image }}"
alt="{{ sponsor.name }} logo"
/>
</a>
{% elif tier.reward_link %}
<a class="sponsors__name sponsors__link" href="{{ sponsor.link }}">
{{ sponsor.name }}
</a>
{% elif tier.reward_name %}
<div class="sponsors__name">{{ sponsor.name }}</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
{% if sponsors.sponsor %}
{% set_global first = true %}
{% set sorted_sponsors = sponsors.sponsor | sort(attribute="amount") | reverse %}
{% set_global past_sponsor_exists = false %}
{% for sponsor in sorted_sponsors %}
{% if sponsor.past %}
{% set_global past_sponsor_exists = true %}
{% endif %}
{% endfor %}
{% if past_sponsor_exists %}
<h2 class="past-donors-title">Past Sponsors</h2>
<div class="past-donor">
{% for sponsor in sorted_sponsors %}
{% if not sponsor.past %}
{% continue %}
{% endif %}
{% if first %}{{ sponsor.name }}{% else %} , {{ sponsor.name }}{% endif %}
{% if first %}
{% set_global first = false %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>