chore: cleanup alt attrs
This commit is contained in:
parent
1232e36745
commit
0c6cc69abf
2 changed files with 7 additions and 9 deletions
|
@ -12,12 +12,17 @@ module.exports = {
|
||||||
}
|
}
|
||||||
if (item.type === 'artist') {
|
if (item.type === 'artist') {
|
||||||
normalized['title'] = item['title']
|
normalized['title'] = item['title']
|
||||||
|
normalized['alt'] = `${item['plays']} plays of ${item['title']}`
|
||||||
normalized['subtext'] = `${item['plays']} plays`
|
normalized['subtext'] = `${item['plays']} plays`
|
||||||
}
|
}
|
||||||
if (item.type === 'book') normalized['alt'] = item['title']
|
if (item.type === 'book') normalized['alt'] = item['title']
|
||||||
if (item.type === 'movie') normalized['title'] = item['title']
|
if (item.type === 'movie') {
|
||||||
|
normalized['title'] = item['title']
|
||||||
|
normalized['alt'] = `${item['title']} - ${item['summary']}`
|
||||||
|
}
|
||||||
if (item.type === 'tv') {
|
if (item.type === 'tv') {
|
||||||
normalized['title'] = item['title']
|
normalized['title'] = item['title']
|
||||||
|
normalized['alt'] = `${item['title']} from ${item['name']}`
|
||||||
normalized['subtext'] = `${item.name} • <strong>${item.episode}</strong>`
|
normalized['subtext'] = `${item.name} • <strong>${item.episode}</strong>`
|
||||||
}
|
}
|
||||||
return normalized
|
return normalized
|
||||||
|
|
|
@ -6,14 +6,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid gap-2 {% if shape == 'square' %}grid-cols-2 md:grid-cols-4{% else %}grid-cols-3 md:grid-cols-6{% endif %} not-prose">
|
<div class="grid gap-2 {% if shape == 'square' %}grid-cols-2 md:grid-cols-4{% else %}grid-cols-3 md:grid-cols-6{% endif %} not-prose">
|
||||||
{% for item in media limit: count %}
|
{% for item in media limit: count %}
|
||||||
{% capture altVal %}
|
{% assign alt = item.alt | strip %}
|
||||||
{% if item.alt %}
|
|
||||||
{{ item.alt }}
|
|
||||||
{% elsif item.title %}
|
|
||||||
{{ item.title }}
|
|
||||||
{% endif %}
|
|
||||||
{% endcapture %}
|
|
||||||
{% assign alt = altVal | strip %}
|
|
||||||
<a href="{{ item.url }}" title="{{ alt | escape }}">
|
<a href="{{ item.url }}" title="{{ alt | escape }}">
|
||||||
<div class="relative block{% if shape == 'square' %} h-full{% endif %}"{% if shape != 'square' %} style="max-width:226px"{% endif %}>
|
<div class="relative block{% if shape == 'square' %} h-full{% endif %}"{% if shape != 'square' %} style="max-width:226px"{% endif %}>
|
||||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300{% if item.title %} bg-cover-gradient{% endif %}"></div>
|
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300{% if item.title %} bg-cover-gradient{% endif %}"></div>
|
||||||
|
|
Reference in a new issue