Skip to content

Commit 26c4157

Browse files
authored
change: contact.njk — the implementation of rendering logic (#284)
change: `contact.njk` — the implementation of rendering logic
2 parents 7b52119 + 594e140 commit 26c4157

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/contact.njk

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ style: 'contact.css'
2323
</header>
2424
<div class="contact-container" data-animation="fade-in" data-delay="2">
2525
<p class="contact-summary">{{ contact.summary | renderMarkdownInline | safe }}</p>
26-
<ul class="social-container">
27-
{% for social in contact.mainSocials %}
28-
<li data-animation="fade-in" data-delay="{{ loop.index }}">{% include "components/snippets/social-items.njk" %}</li>
29-
{% endfor %}
30-
</ul>
31-
<ul class="social-container social-container__small">
32-
{% for social in contact.socials %}
33-
{% if social.hidden !== true %}
34-
<li data-animation="fade-in" data-delay="{{ loop.index }}">{% include "components/snippets/social-items.njk" %}</li>
35-
{% endif %}
36-
{% endfor %}
37-
</ul>
26+
{% for socials, containerClass in [
27+
[contact.mainSocials, "social-container"],
28+
[contact.socials, "social-container social-container__small"]
29+
] %}
30+
<ul class="{{ containerClass }}">
31+
{% for social in socials %}
32+
{% if containerClass == "social-container" or social.hidden !== true %}
33+
<li data-animation="fade-in" data-delay="{{ loop.index }}">{% include "components/snippets/social-items.njk" %}</li>
34+
{% endif %}
35+
{% endfor %}
36+
</ul>
37+
{% endfor %}
3838
</div>
3939
</div>
4040
</section>

0 commit comments

Comments
 (0)