fix: genre control flow

This commit is contained in:
Cory Dransfeldt 2024-08-07 13:01:44 -07:00
parent 9c8e07bd8a
commit 23906da619
No known key found for this signature in database
3 changed files with 6 additions and 5 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "21.6.2",
"version": "21.6.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "21.6.2",
"version": "21.6.3",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.4.0",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "21.6.2",
"version": "21.6.3",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"scripts": {

View file

@ -16,6 +16,7 @@ schema: genre
is
{% endif %}
{%- endcapture -%}
{%- assign mediaLinks = genre.artists | sortByPlaysDescending: "total_plays" | mediaLinks: "artist", 5 -%}
{%- capture js -%}
{% render "../../../assets/scripts/text-toggle.js" %}
{%- endcapture -%}
@ -24,8 +25,8 @@ schema: genre
<a class="back-link-header link-icon" href="/music" title="Go back to the music index page">{% tablericon "arrow-left" "Go back to the music index page" %} Back to music</a>
<h2 class="page-header">{{ genre.name }}</h2>
<article class="genre-focus">
{%- if genre.total_plays > 0 -%}
<p>My top <strong class="highlight-text">{{ genre.name }}</strong> artists {{ connectingWord }} {{ genre.artists | sortByPlaysDescending: "total_plays" | mediaLinks: "artist", 5 }}. I've listened to <strong class="highlight-text">{{ genre.total_plays | formatNumber }}</strong> tracks form this genre.</p>
{%- if mediaLinks -%}
<p>My top <strong class="highlight-text">{{ genre.name }}</strong> artists {{ connectingWord }} {{ mediaLinks }}. I've listened to <strong class="highlight-text">{{ genre.total_plays | formatNumber }}</strong> tracks form this genre.</p>
<hr />
{% endif %}
{%- if genre.description -%}