Skip to content

Commit 116cbf5

Browse files
committed
Refactor: スポンサー企業のご紹介ページを sponsors.yml に対応
1 parent d192b97 commit 116cbf5

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

_posts/2023-07-27-sponsor.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
# thumbnail:
77
permalink: /posts/sponsors/
88
---
9+
10+
{% assign platinum_sponsors = site.data.sponsors | where: "type", "platinum" %}
11+
{% assign gold_sponsors = site.data.sponsors | where: "type", "gold" %}
12+
{% assign silver_sponsors = site.data.sponsors | where: "type", "silver" %}
13+
{% assign bronze_sponsors = site.data.sponsors | where: "type", "bronze" %}
14+
{% assign inkind_sponsors = site.data.sponsors | where: "type", "inkind" %}
15+
{% assign individual_sponsors = site.data.sponsors | where: "type", "individual" %}
16+
917
<p>
1018
DojoCon Japan 2023は、スポンサー企業のご協力により開催されています。協賛くださいました、企業のみなさまありがとうございます。
1119
</p>
12-
{% if site.data.sponsor.platinum and site.data.sponsor.platinum.size != 0 %}
20+
{% if platinum_sponsors != empty %}
1321
<div id="platinum-sponsors" class="sponsors-container">
1422
<h3>Platinum Sponsor</h3>
1523
<ul>
16-
{% for sponsor in site.data.sponsor.platinum %}
24+
{% for sponsor in platinum_sponsors %}
1725
<li id="{{ sponsor.id }}">
1826
<a href="{{ sponsor.link }}" target="_blank">
1927
<img src="/img/{{ site.year }}/sponsor/{{ sponsor.logo }}" alt="{{ sponsor.name }}" />
@@ -26,11 +34,11 @@ <h3>Platinum Sponsor</h3>
2634
</div>
2735
{% endif %}
2836

29-
{% if site.data.sponsor.gold and site.data.sponsor.gold.size != 0 %}
37+
{% if gold_sponsors != empty %}
3038
<div id="gold-sponsors" class="sponsors-container">
3139
<h3>Gold Sponsor</h3>
3240
<ul>
33-
{% for sponsor in site.data.sponsor.gold %}
41+
{% for sponsor in gold_sponsors %}
3442
<li id="{{ sponsor.id }}">
3543
<a href="{{ sponsor.link }}" target="_blank">
3644
<img src="/img/{{ site.year }}/sponsor/{{ sponsor.logo }}" alt="{{ sponsor.name }}" />
@@ -43,11 +51,11 @@ <h3>Gold Sponsor</h3>
4351
</div>
4452
{% endif %}
4553

46-
{% if site.data.sponsor.silver and site.data.sponsor.silver.size != 0 %}
54+
{% if silver_sponsors != empty %}
4755
<div id="silver-sponsors" class="sponsors-container">
4856
<h3>Sliver Sponsor</h3>
4957
<ul>
50-
{% for sponsor in site.data.sponsor.silver %}
58+
{% for sponsor in silver_sponsors %}
5159
<li id="{{ sponsor.id }}">
5260
<a href="{{ sponsor.link }}" target="_blank">
5361
<img src="/img/{{ site.year }}/sponsor/{{ sponsor.logo }}" alt="{{ sponsor.name }}" />
@@ -60,11 +68,11 @@ <h3>Sliver Sponsor</h3>
6068
</div>
6169
{% endif %}
6270

63-
{% if site.data.sponsor.bronze and site.data.sponsor.bronze.size != 0 %}
71+
{% if bronze_sponsors != empty %}
6472
<div id="bronze-sponsors" class="sponsors-container">
6573
<h3>Bronze Sponsor</h3>
6674
<ul>
67-
{% for sponsor in site.data.sponsor.bronze %}
75+
{% for sponsor in bronze_sponsors %}
6876
<li id="{{ sponsor.id }}">
6977
<a href="{{ sponsor.link }}" target="_blank">
7078
<img src="/img/{{ site.year }}/sponsor/{{ sponsor.logo }}" alt="{{ sponsor.name }}" />

0 commit comments

Comments
 (0)