feat: paginate watching pages + music updates
This commit is contained in:
parent
9c0f47278c
commit
0d926fd844
25 changed files with 141 additions and 90 deletions
|
@ -0,0 +1,27 @@
|
|||
<div class="watching grid">
|
||||
{% for item in data.items %}
|
||||
{% capture alt %}{{ item.title | escape }} ({{ item.year }}){% endcapture %}
|
||||
<a href="{{ item.url }}">
|
||||
<div class="watching item shadow">
|
||||
<div class="meta-text">
|
||||
{% if item.type == 'movie' %}
|
||||
<div class="header">{{ item.title }}</div>
|
||||
<div class="subheader flex-centered gap-xs">
|
||||
{{ item.year }}
|
||||
{% if rating and item.rating %}
|
||||
<span class="rating"> ({{ item.rating }})</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="header">{{ item.name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- capture loadingStrategy -%}
|
||||
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<img src="https://coryd.dev/.netlify/images/?url={{ item.backdrop }}&fit=cover&w=256&h=144&fm=webp&q=85" alt="{{ alt }}" loading="{{ loadingStrategy }}" decoding="async" width="256" height="144" />
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% render "partials/widgets/paginator.liquid", pagination:data %}
|
|
@ -1,28 +1,26 @@
|
|||
{% if mediaItems.size > 0 %}
|
||||
<div class="watching grid">
|
||||
{% for media in mediaItems limit: count %}
|
||||
{% capture alt %}{{ media.title | escape }} ({{ media.year }}){% endcapture %}
|
||||
<a href="{{ media.url }}">
|
||||
<div class="watching item shadow">
|
||||
<div class="meta-text">
|
||||
{% if media.type == 'movie' %}
|
||||
<div class="header">{{ media.title }}</div>
|
||||
<div class="subheader flex-centered gap-xs">
|
||||
{{ media.year }}
|
||||
{% if rating and media.rating %}
|
||||
<span class="rating"> ({{ media.rating }})</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="header">{{ media.name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- capture loadingStrategy -%}
|
||||
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<img src="https://coryd.dev/.netlify/images/?url={{ media.backdrop }}&fit=cover&w=256&h=144&fm=webp&q=85" alt="{{ alt }}" loading="{{ loadingStrategy }}" decoding="async" width="256" height="144" />
|
||||
<div class="watching grid">
|
||||
{% for media in mediaItems limit: count %}
|
||||
{% capture alt %}{{ media.title | escape }} ({{ media.year }}){% endcapture %}
|
||||
<a href="{{ media.url }}">
|
||||
<div class="watching item shadow">
|
||||
<div class="meta-text">
|
||||
{% if media.type == 'movie' %}
|
||||
<div class="header">{{ media.title }}</div>
|
||||
<div class="subheader flex-centered gap-xs">
|
||||
{{ media.year }}
|
||||
{% if rating and media.rating %}
|
||||
<span class="rating"> ({{ media.rating }})</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="header">{{ media.name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- capture loadingStrategy -%}
|
||||
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<img src="https://coryd.dev/.netlify/images/?url={{ media.backdrop }}&fit=cover&w=256&h=144&fm=webp&q=85" alt="{{ alt }}" loading="{{ loadingStrategy }}" decoding="async" width="256" height="144" />
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
Reference in a new issue