chore: book meta

This commit is contained in:
Cory Dransfeldt 2024-05-17 13:39:15 -07:00
parent 42ea508d46
commit d680a11905
No known key found for this signature in database
4 changed files with 17 additions and 19 deletions

View file

@ -206,8 +206,9 @@ export default {
}
if (item.type === 'book') {
normalized['alt'] = `${item['title']} by ${item['authors']}`
normalized['subtext'] = `${item['percentage']} finished`
normalized['percentage'] = item['percentage']
normalized['title'] = `${item['title']} by ${item['authors']}`
normalized['rating'] = item['rating']
if (item['rating']) normalized['subtext'] = item['rating']
}
if (item.type === 'tv') {
normalized['title'] = item['title']

4
package-lock.json generated
View file

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

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "15.4.2",
"version": "15.4.3",
"description": "The source for my personal site. Built using 11ty.",
"type": "module",
"scripts": {

View file

@ -3,21 +3,18 @@
<div class="media-grid {% if shape == 'square' %}square{% else %}vertical{% endif %}">
{% for item in media limit: count %}
{% assign alt = item.alt | strip | escape %}
{% assign hasMeta = item.type != 'book' %}
<a href="{{ item.url | stripUtm }}" title="{{ alt }}">
<div class="item-wrapper{% if hasMeta %} shadow{% endif %}">
{% if hasMeta %}
<div class="meta-text">
{% if item.title %}
<div class="header">{{ item.title }}</div>
{% endif %}
{% if item.subtext %}
<div class="subheader">
{{ item.subtext }}
</div>
{% endif %}
</div>
{% endif %}
<div class="item-wrapper shadow">
<div class="meta-text">
{% if item.title %}
<div class="header">{{ item.title }}</div>
{% endif %}
{% if item.subtext %}
<div class="subheader">
{{ item.subtext }}
</div>
{% endif %}
</div>
{%- capture loadingStrategy -%}
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
{%- endcapture -%}