feat: recently watched pages

This commit is contained in:
Cory Dransfeldt 2024-05-20 13:17:54 -07:00
parent 53a5fbd906
commit 9fdb0db1fb
No known key found for this signature in database
12 changed files with 98 additions and 64 deletions

View file

@ -9,19 +9,19 @@
{% endif %}
{%- endcapture -%}
{%- capture ogImage -%}
{% if schema == 'blog' %}
{%- if schema == 'blog' -%}
{{ meta.url }}/assets/img/ogi/{{ title | slugifyString }}-preview.png
{% elsif schema == 'music' %}
{%- elsif schema == 'music' -%}
{{ music.recent.artists[0].image }}
{% elsif schema == 'watching' %}
{%- elsif schema == 'watching' -%}
{%- assign featuredMovie = movies.recentlyWatched | first -%}
{{ featuredMovie.backdrop }}
{% elsif schema == 'books' %}
{%- elsif schema == 'books' -%}
{%- assign featuredBook = books | bookStatus: 'started' | reverse | first -%}
{{ featuredBook.image }}
{% else %}
{%- else -%}
{{ meta.meta_data.opengraph_default }}
{% endif %}
{%- endif -%}
{%- endcapture -%}
<!doctype html>
<html lang="en">

View 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 %}

View file

@ -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 %}