fix: label

This commit is contained in:
Cory Dransfeldt 2024-08-28 15:01:05 -07:00
parent d16c6ab038
commit fc62bdf104
No known key found for this signature in database
4 changed files with 19 additions and 5 deletions

4
package-lock.json generated
View file

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

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "24.1.5", "version": "24.1.6",
"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

@ -7,7 +7,14 @@
</p> </p>
<ul> <ul>
{% for artist in artists %} {% for artist in artists %}
<li><a href="{{ artist.url }}">{{ artist.name }}</a>{%- if artist.total_plays > 0 -%}: <strong class="highlight-text">{{ artist.total_plays }} plays</strong>{%- endif -%}</li> {%- capture playLabel -%}
{%- if artist.total_plays == 1 -%}
play
{%- else -%}
plays
{%- endif -%}
{%- endcapture -%}
<li><a href="{{ artist.url }}">{{ artist.name }}</a>{%- if artist.total_plays > 0 -%}: <strong class="highlight-text">{{ artist.total_plays }} {{ playLabel }}</strong>{%- endif -%}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<hr /> <hr />

View file

@ -14,6 +14,13 @@ schema: artist
{%- capture js -%} {%- capture js -%}
{% render "../../../../assets/scripts/text-toggle.js" %} {% render "../../../../assets/scripts/text-toggle.js" %}
{%- endcapture -%} {%- endcapture -%}
{%- capture playLabel -%}
{%- if artist.totalPlays == 1 -%}
play
{%- else -%}
plays
{%- endif -%}
{%- endcapture -%}
<script>{{ js }}</script> <script>{{ js }}</script>
<noscript><style>[data-toggle-content].text-toggle-hidden {height: unset !important;overflow: unset !important;margin-bottom: unset !important;}[data-toggle-content].text-toggle-hidden::after {display: none !important;}</style></noscript> <noscript><style>[data-toggle-content].text-toggle-hidden {height: unset !important;overflow: unset !important;margin-bottom: unset !important;}[data-toggle-content].text-toggle-hidden::after {display: none !important;}</style></noscript>
<a 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 href="/music" title="Go back to the music index page">{% tablericon "arrow-left" "Go back to the music index page" %} Back to music</a>
@ -46,7 +53,7 @@ schema: artist
<p class="sub-meta tattoo">{% tablericon "needle" "Tattoo" %} I have a tattoo inspired by this artist!</p> <p class="sub-meta tattoo">{% tablericon "needle" "Tattoo" %} I have a tattoo inspired by this artist!</p>
{%- endif -%} {%- endif -%}
{%- if artist.totalPlays > 0 -%} {%- if artist.totalPlays > 0 -%}
<p class="sub-meta"><strong class="highlight-text">{{ artist.totalPlays }} plays</strong></p> <p class="sub-meta"><strong class="highlight-text">{{ artist.totalPlays }} {{ playLabel }}</strong></p>
{%- endif -%} {%- endif -%}
<p class="sub-meta"> <p class="sub-meta">
<a href="/music/genres/{{ artist.genre | replace: '/', '-' | slugify | downcase }}" title="Learn more about {{ artist.genre | escape }}"> <a href="/music/genres/{{ artist.genre | replace: '/', '-' | slugify | downcase }}" title="Learn more about {{ artist.genre | escape }}">