chore: modularize now page
This commit is contained in:
parent
c5c04214cc
commit
cc6d813fed
10 changed files with 196 additions and 188 deletions
16
src/_includes/partials/now/albumReleases.liquid
Normal file
16
src/_includes/partials/now/albumReleases.liquid
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% if albumReleases.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "calendar" "Anticipated albums" "height=28" %}
|
||||
<div class="ml-1">Anticipated albums</div>
|
||||
</h2>
|
||||
<ul class="list-inside list-disc pl-5 md:pl-10">
|
||||
{% for album in albumReleases %}
|
||||
<li class="mt-1.5 mb-2">
|
||||
<span class="font-bold">{{ album.startDate | readableDate }}: </span>
|
||||
<a href="https://{{album.location}}" title="{{album.summary | escape}}">
|
||||
{{album.summary}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
23
src/_includes/partials/now/albums.liquid
Normal file
23
src/_includes/partials/now/albums.liquid
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% if music.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "musical-note" "Albums" "height=28" %}
|
||||
<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.albums %}
|
||||
<a href="https://rateyourmusic.com/search?searchtype=l&searchterm={{album.name | escape}}%20{{ album.artist | escape }}" 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-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></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.art, albumName, 'rounded-lg w-full h-full', '225px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
24
src/_includes/partials/now/artists.liquid
Normal file
24
src/_includes/partials/now/artists.liquid
Normal file
|
@ -0,0 +1,24 @@
|
|||
{% if music.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "microphone" "Artists" "height=28" %}
|
||||
<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.artists %}
|
||||
<a href="https://rateyourmusic.com/search?searchterm={{ artist.artist | escape }}" title="{{artist.artist | escape}}">
|
||||
<div class="relative block">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></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.artist }}</div>
|
||||
<div class="px-1 text-xs text-white">
|
||||
{{ artist.plays }} plays
|
||||
</div>
|
||||
</div>
|
||||
{%- capture artistImg %}{{ artist.artist | artist }}{% endcapture -%}
|
||||
{%- capture artistName %}{{ artist.artist | escape }}{% endcapture -%}
|
||||
{% image artistImg, artistName, 'rounded-lg w-full', '225px', 'eager' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
18
src/_includes/partials/now/books.liquid
Normal file
18
src/_includes/partials/now/books.liquid
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% if books.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "book-open" "Books" "height=28" %}
|
||||
<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-purple-500 dark:border-purple-400 dark:hover:border-purple-500"></div>
|
||||
{%- capture bookImg %}{{book.cover}}{% endcapture -%}
|
||||
{%- capture bookName %}{{book.title | escape}}{% endcapture -%}
|
||||
{% image bookImg, bookName, 'rounded-lg w-full h-full', '180px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
15
src/_includes/partials/now/links.liquid
Normal file
15
src/_includes/partials/now/links.liquid
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% if links.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "link" "Links" "height=28" %}
|
||||
<div class="ml-1">Links</div>
|
||||
</h2>
|
||||
<ul class="list-inside list-disc pl-5 md:pl-10">
|
||||
{% for link in links %}
|
||||
<li class="mt-1.5 mb-2">
|
||||
<a href="{{link.url}}" title="{{link.title | escape}}">
|
||||
{{ link.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
21
src/_includes/partials/now/movies.liquid
Normal file
21
src/_includes/partials/now/movies.liquid
Normal file
|
@ -0,0 +1,21 @@
|
|||
{% if movies.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "film" "Movies" "height=28" %}
|
||||
<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 %}
|
||||
<a href="{{movie.link}}" title="{{movie.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-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></div>
|
||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||
<div class="px-1 text-xs font-bold text-white">{{ movie.title }}</div>
|
||||
</div>
|
||||
{%- capture movieImg %}{{movie.image | cdn: site.letterboxd-host, site.cdn-movies}}{% endcapture -%}
|
||||
{%- capture movieName %}{{movie.title | escape}}{% endcapture -%}
|
||||
{% image movieImg, movieName, 'rounded-lg w-full', '180px' %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
4
src/_includes/partials/now/status.liquid
Normal file
4
src/_includes/partials/now/status.liquid
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p class="my-2 flex flex-row items-start md:items-center">
|
||||
<span class="pt-1 md:pt-0 mr-1">{{ status.emoji }}</span>
|
||||
<span>{{ status.content }}</span>
|
||||
</p>
|
24
src/_includes/partials/now/tv.liquid
Normal file
24
src/_includes/partials/now/tv.liquid
Normal file
|
@ -0,0 +1,24 @@
|
|||
{% if tv.size > 0 %}
|
||||
<h2 class="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">
|
||||
{% heroicon "outline" "tv" "TV" "height=28" %}
|
||||
<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-purple-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-purple-500"></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