HiddenSounds/_includes/songlist.html

19 lines
814 B
HTML
Raw Permalink 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.data.artists | where: 'sname', artistName | first -%}
{%- if artist -%}
<a href="{{ artist.sname | datapage_url: 'artists' }}">{{ artist.sname }}</a>
{%- else -%}
{{ artistName }}
{%- endif -%}
{%- endfor -%}
{% comment %} Space needed {% endcomment %} - <a href="{{ site.baseurl }}/{{ song.sid | datapage_url: 'songs' }}">{{ song.sname }}</a>
</p>
</div>