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", "name": "coryd.dev",
"version": "21.6.2", "version": "21.6.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "21.6.2", "version": "21.6.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@cdransf/api-text": "^1.4.0", "@cdransf/api-text": "^1.4.0",

View file

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

View file

@ -16,6 +16,7 @@ schema: genre
is is
{% endif %} {% endif %}
{%- endcapture -%} {%- endcapture -%}
{%- assign mediaLinks = genre.artists | sortByPlaysDescending: "total_plays" | mediaLinks: "artist", 5 -%}
{%- capture js -%} {%- capture js -%}
{% render "../../../assets/scripts/text-toggle.js" %} {% render "../../../assets/scripts/text-toggle.js" %}
{%- endcapture -%} {%- 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> <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> <h2 class="page-header">{{ genre.name }}</h2>
<article class="genre-focus"> <article class="genre-focus">
{%- if genre.total_plays > 0 -%} {%- if mediaLinks -%}
<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> <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 /> <hr />
{% endif %} {% endif %}
{%- if genre.description -%} {%- if genre.description -%}