This commit is contained in:
@ -1,3 +1,4 @@
|
||||
{% import "macros.html" as macros %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -15,7 +16,7 @@
|
||||
</section>
|
||||
<section class="song-list">
|
||||
{% for song in section.pages %}
|
||||
<div>
|
||||
<div class="{{ macros::primary_category(song=song) }}">
|
||||
<div class="meta">
|
||||
<div class="title">{{ song.title }}</div>
|
||||
{% if song.taxonomies["artist"] %}
|
||||
@ -23,10 +24,10 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="links">
|
||||
<a href="{{ song.permalink }}">html</a>
|
||||
<a href="{{ song.permalink }}" class="html"></a>
|
||||
{% for asset in song.assets %}
|
||||
{% if asset is matching(song.slug~"[.](pdf)$") %}
|
||||
<a href="{{ asset }}">pdf</a>
|
||||
<a href="{{ asset }}" class="pdf"></a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
5
templates/macros.html
Normal file
5
templates/macros.html
Normal file
@ -0,0 +1,5 @@
|
||||
{% macro primary_category(song) %}
|
||||
{%- if song.taxonomies["category"] -%}
|
||||
{{ song.taxonomies["category"][0] }}
|
||||
{%- endif -%}
|
||||
{% endmacro %}
|
Reference in New Issue
Block a user