don't show empty CV topics

This commit is contained in:
Tom Hodson 2022-07-08 11:11:06 +01:00
parent 8fc908535e
commit 77e23d492d

39
cv.html
View File

@ -9,30 +9,33 @@ redirect_from:
or have a look at my <a href="/blog">blog</a>. Click any item for a little more detail. or have a look at my <a href="/blog">blog</a>. Click any item for a little more detail.
</p> </p>
{% for topic in site.data.cv_topics %} {% for topic in site.data.cv_topics %}
{% assign work = site.cv_entries | where:'type', topic.id %}
{% if work.size > 0 %}
<div class = "cv-title-container"> <div class = "cv-title-container">
<h2>{{topic.name}}</h2> <h2>{{topic.name}}</h2>
<a onClick='toggle_summary_by_class(this, "{{topic.id}}");'>Expand all</a> <a onClick='toggle_summary_by_class(this, "{{topic.id}}");'>Expand all</a>
</div> </div>
{% assign work = site.cv_entries | where:'type', topic.id %}
{% for entry in work %} {% for entry in work %}
<details class="{{topic.id}}"> <details class="{{topic.id}}">
<summary class="cv"><time>{{entry.period}}</time> <summary class="cv"><time>{{entry.period}}</time>
<div class = "title-column"> <div class = "title-column">
<h3>{{entry.title}}</h3> <h3>{{entry.title}}</h3>
<span class="location">{{entry.location}}</span> <span class="location">{{entry.location}}</span>
</div> </div>
</summary> </summary>
<div class = "details-container"> <div class = "details-container">
<div class = "details-img"> <div class = "details-img">
<a href="{{entry.url}}"><img src="{{entry.image}}" alt="{{entry.alt}}"></a> <a href="{{entry.url}}"><img src="{{entry.image}}" alt="{{entry.alt}}"></a>
</div> </div>
<div class = "details-text"> <div class = "details-text">
{{entry.excerpt}} {{entry.excerpt}}
{% if entry.read_more %}<a href = "{{entry.url}}">Read more.</a>{% endif %} {% if entry.read_more %}<a href = "{{entry.url}}">Read more.</a>{% endif %}
</div> </div>
</div> </div>
</details> </details>
{% endfor %} {% endfor %}
{% endif %}
{% endfor %} {% endfor %}