Skip to content

Commit c45d2ac

Browse files
committed
don't show empty sections in publication list
1 parent 40e9755 commit c45d2ac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

publications.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ mathjax: yes
1010
{% assign publicationsSorted = site.data.publications | sort: "created" %}
1111

1212
{% for category in site.data.publication_types %}
13+
{% assign categoryPublications = publicationsSorted | where: "category", category %}
14+
{% unless categoryPublications.size == 0 %}
1315
<h3>{{ category }}</h3>
1416
<ul class="publication-list">
15-
{% for publication in publicationsSorted reversed %}
17+
{% for publication in categoryPublications reversed %}
1618
{% if publication.category == category %}
1719
<li class="publication">
1820
<span class="publication-title">{{ publication.title }}</span>
@@ -45,4 +47,5 @@ mathjax: yes
4547
{% endif %}
4648
{% endfor %}
4749
</ul>
50+
{% endunless %}
4851
{% endfor %}

0 commit comments

Comments
 (0)