Skip to content

Commit

Permalink
Adding image component so the same logic is applied everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
beta-ziliani committed Jun 4, 2024
1 parent ff8c09e commit 46f9ef6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
5 changes: 5 additions & 0 deletions _includes/components/sponsor-image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- if include.logo %}
<img src="/assets/{{ include.logo }}" alt="">
{%- else %}
<img src="/assets/sponsors/empty.svg" alt="">
{%- endif %}
12 changes: 2 additions & 10 deletions _includes/components/top-sponsors-icons.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
<div class="top-sponsors top-sponsors--l">
{%- for sponsor in site.data.sponsor_logos_l %}
<a href="{{ sponsor.url }}" rel="nofollow sponsored">
{%- if sponsor.logo %}
<img src="/assets/{{ sponsor.logo }}" alt="">
{%- else %}
<img src="/assets/sponsors/empty.svg" alt="">
{%- endif %}
{% include components/sponsor-image.html logo=sponsor.logo %}
{{- sponsor.name }}
</a>
{%- endfor %}
</div>
<div class="top-sponsors top-sponsors--s">
{%- for sponsor in site.data.sponsor_logos_s %}
<a href="{{ sponsor.url }}" rel="nofollow sponsored">
{%- if sponsor.logo %}
<img src="/assets/{{ sponsor.logo }}" alt="">
{%- else %}
<img src="/assets/sponsors/empty.svg" alt="">
{%- endif %}
{% include components/sponsor-image.html logo=sponsor.logo %}
{{- sponsor.name }}
</a>
{%- endfor %}
Expand Down
14 changes: 7 additions & 7 deletions _includes/pages/sponsors/sponsor-cards.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<ul class="cards-list">
{%- for sp in site.data.sponsor_logos_l %}
<li class="sponsor-card">
<a href="{{ sp.url }}" class="name" rel="sponsored nofollow">{{ sp.name }}</a>
<img src="/assets/{{ sp.logo }}" alt="Logo of {{sp.name}}">
<span class="last-payment" title="Last payment">{{ sp.last_payment }} per month since {{ sp.since }}</span>
<span class="all-time" title="All-time total">{{ sp.all_time }}</span>
</li>
<li class="sponsor-card">
<a href="{{ sp.url }}" class="name" rel="sponsored nofollow">{{ sp.name }}</a>
{% include components/sponsor-image.html logo=sp.logo %}
<span class="last-payment" title="Last payment">{{ sp.last_payment }} per month since {{ sp.since }}</span>
<span class="all-time" title="All-time total">{{ sp.all_time }}</span>
</li>
{%- endfor %}
</ul>
</ul>

0 comments on commit 46f9ef6

Please sign in to comment.