feat: dry up + normalize now page
This commit is contained in:
parent
022ce82f81
commit
6dda493d7b
13 changed files with 86 additions and 136 deletions
|
@ -1,23 +0,0 @@
|
|||
{% if music.size > 0 %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon "vinyl" "Albums" %}
|
||||
<div class="ml-1">Albums</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 gap-2 md:grid-cols-4 not-prose">
|
||||
{% for album in music %}
|
||||
<a href="{{ album.url }}" title="{{album.name | escape}} by {{ album.artist | escape }}">
|
||||
<div class="relative block h-full">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div>
|
||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||
<div class="px-1 text-xs font-bold text-white line-clamp-2">{{ album.name }}</div>
|
||||
<div class="px-1 text-xs text-white line-clamp-2">
|
||||
{{ album.artist }}
|
||||
</div>
|
||||
</div>
|
||||
{%- capture albumName %}{{ album.name | escape }}{% endcapture -%}
|
||||
{% image album.image, albumName, 'rounded-lg w-full h-full', '225px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -1,24 +0,0 @@
|
|||
{% if music.size > 0 %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon "microphone-2" "Artists" %}
|
||||
<div class="ml-1">Artists</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-2 gap-2 md:grid-cols-4 not-prose">
|
||||
{% for artist in music %}
|
||||
<a href="{{ artist.url }}" title="{{artist.name | escape}}">
|
||||
<div class="relative block">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div>
|
||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||
<div class="px-1 text-xs font-bold text-white line-clamp-2">{{ artist.name }}</div>
|
||||
<div class="px-1 text-xs text-white">
|
||||
{{ artist.plays }} plays
|
||||
</div>
|
||||
</div>
|
||||
{%- capture artistImg %}{{ artist.image }}{% endcapture -%}
|
||||
{%- capture artistName %}{{ artist.name | escape }}{% endcapture -%}
|
||||
{% image artistImg, artistName, 'rounded-lg w-full', '225px', 'eager' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -1,18 +0,0 @@
|
|||
{% if books.size > 0 %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon "books" "Books" %}
|
||||
<div class="ml-1">Books</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-3 gap-2 md:grid-cols-6 not-prose">
|
||||
{% for book in books %}
|
||||
<a href="{{book.link}}" title="{{book.title | escape}}">
|
||||
<div class="relative block" style="max-width:226px">
|
||||
<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"></div>
|
||||
{%- capture bookImg %}{{book.image}}{% endcapture -%}
|
||||
{%- capture bookName %}{{book.title | escape}}{% endcapture -%}
|
||||
{% image bookImg, bookName, 'rounded-lg w-full h-full', '180px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
36
src/_includes/partials/now/media-grid.liquid
Normal file
36
src/_includes/partials/now/media-grid.liquid
Normal file
|
@ -0,0 +1,36 @@
|
|||
{% if data.size > 0 %}
|
||||
{% assign media = data | normalizeMedia %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon icon title %}
|
||||
<div class="ml-1">{{ title }}</div>
|
||||
</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">
|
||||
{% for item in media limit: count %}
|
||||
{% capture altVal %}
|
||||
{% if item.alt %}
|
||||
{{ item.alt }}
|
||||
{% elsif item.title %}
|
||||
{{ item.title }}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
{% assign alt = altVal | strip %}
|
||||
<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="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-1 bottom-2 drop-shadow-md">
|
||||
{% if item.title %}
|
||||
<div class="px-1 text-xs font-bold text-white line-clamp-2">{{ item.title }}</div>
|
||||
{% endif %}
|
||||
{% if item.subtext %}
|
||||
<div class="px-1 text-xs text-white line-clamp-2">
|
||||
{{ item.subtext }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{%- capture size %}{% if shape == 'square' %}225px{% else %}180px{% endif %}{% endcapture -%}
|
||||
{% image item.image, alt, 'rounded-lg w-full h-full', size %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -1,21 +0,0 @@
|
|||
{% if movies.size > 0 %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon "movie" "Movies" %}
|
||||
<div class="ml-1">Movies</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-3 gap-2 md:grid-cols-6 not-prose">
|
||||
{% for movie in movies limit: 6 %}
|
||||
<a href="{{movie.url}}" title="{{movie.name | escape}}">
|
||||
<div class="relative block" style="max-width:226px">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div>
|
||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||
<div class="px-1 text-xs font-bold text-white">{{ movie.name }}</div>
|
||||
</div>
|
||||
{%- capture movieImg %}{{ movie.image }}{% endcapture -%}
|
||||
{%- capture movieSummary %}{{ movie.summary }}{% endcapture -%}
|
||||
{% image movieImg, movieSummary, 'rounded-lg w-full', '180px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
|
@ -1,24 +0,0 @@
|
|||
{% if tv.size > 0 %}
|
||||
<h2 class="icon--bold m-0 text-xl flex flex-row items-center font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4 icon--28">
|
||||
{% tablericon "device-tv" "TV" %}
|
||||
<div class="ml-1">TV</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-3 gap-2 md:grid-cols-6 not-prose">
|
||||
{% for episode in tv %}
|
||||
<a href="https://trakt.tv/shows/{{episode.show.ids.slug}}/seasons/{{ episode.episode.season }}/episodes/{{ episode.episode.number }}" title="{{ episode.episode.title | escape}} {{ episode.show.title | escape }}">
|
||||
<div class="relative block" style="max-width:226px">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div>
|
||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||
<div class="px-1 text-xs font-bold text-white">{{ episode.episode.title }}</div>
|
||||
<div class="px-1 text-xs text-white">
|
||||
{{ episode.show.title }} • <strong>S{{ episode.episode.season }}E{{ episode.episode.number }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
{%- capture tvImg %}{{episode.show.title | tv}}{% endcapture -%}
|
||||
{%- capture tvName %}{{ episode.episode.title | escape}} - {{ episode.show.title | escape }}{% endcapture -%}
|
||||
{% image tvImg, tvName, 'rounded-lg w-full', '180px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
Reference in a new issue