HiddenSounds/_includes/songlist.html

18 lines
690 B
HTML
Raw Normal View History

<div class="song">
<p>
{%- assign isFirst = true -%}
{%- for artistName in song.artists -%}
{%- if isFirst == true -%}
{%- assign isFirst = false -%}
{%- else -%}, {% comment %} Comma and space to separate artists {% endcomment %}
{%- endif -%}
{%- assign artist = site.artists | where: 'name', artistName | first -%}
{%- if artist -%}
<a href="{{ artist.url | prepend: site.baseurl }}">{{ artist.name }}</a>
{%- else -%}
{{ artistName }}
{%- endif -%}
{%- endfor -%}
{% comment %} Space needed {% endcomment %} - <a href="{{ song.url }}">{{ song.name }}</a>
</p>
</div>