feat: recently watched pages
This commit is contained in:
parent
53a5fbd906
commit
9fdb0db1fb
12 changed files with 98 additions and 64 deletions
28
src/_includes/partials/media/watching/backdrop-grid.liquid
Normal file
28
src/_includes/partials/media/watching/backdrop-grid.liquid
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% 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=75" alt="{{ alt }}" loading="{{ loadingStrategy }}" decoding="async" width="256" height="144" />
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -1,23 +0,0 @@
|
|||
{% if favorites.size > 0 %}
|
||||
<div class="watching grid">
|
||||
{% for favorite in favorites limit: count %}
|
||||
{% capture alt %}{{ favorite.title | escape }} ({{ favorite.year }}){% endcapture %}
|
||||
<a href="{{ favorite.url }}">
|
||||
<div class="watching item shadow">
|
||||
<div class="meta-text">
|
||||
{% if favorite.type == 'movie' %}
|
||||
<div class="header">{{ favorite.title }}</div>
|
||||
<div class="subheader">{{ favorite.year }}</div>
|
||||
{% else %}
|
||||
<div class="header">{{ favorite.name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- capture loadingStrategy -%}
|
||||
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
<img src="https://coryd.dev/.netlify/images/?url={{ favorite.backdrop }}&fit=cover&w=256&h=144&fm=webp&q=75" alt="{{ alt }}" loading="{{ loadingStrategy }}" decoding="async" width="256" height="144" />
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
Reference in a new issue