Basic styling for song-list
All checks were successful
Build / build (push) Successful in 5m31s

This commit is contained in:
2024-02-06 19:49:24 +01:00
parent 1ba00b087d
commit 51f29734ee
3 changed files with 45 additions and 5 deletions

View File

@ -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
View File

@ -0,0 +1,5 @@
{% macro primary_category(song) %}
{%- if song.taxonomies["category"] -%}
{{ song.taxonomies["category"][0] }}
{%- endif -%}
{% endmacro %}