From cc6d813fedf113badff95356987eb0620c2b23fb Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 10 Jul 2023 11:17:26 -0700 Subject: [PATCH] chore: modularize now page --- src/_includes/now.liquid | 196 +----------------- .../partials/now/albumReleases.liquid | 16 ++ src/_includes/partials/now/albums.liquid | 23 ++ src/_includes/partials/now/artists.liquid | 24 +++ src/_includes/partials/now/books.liquid | 18 ++ src/_includes/partials/now/links.liquid | 15 ++ src/_includes/partials/now/movies.liquid | 21 ++ src/_includes/partials/now/status.liquid | 4 + src/_includes/partials/now/tv.liquid | 24 +++ src/now.html | 43 ++++ 10 files changed, 196 insertions(+), 188 deletions(-) create mode 100644 src/_includes/partials/now/albumReleases.liquid create mode 100644 src/_includes/partials/now/albums.liquid create mode 100644 src/_includes/partials/now/artists.liquid create mode 100644 src/_includes/partials/now/books.liquid create mode 100644 src/_includes/partials/now/links.liquid create mode 100644 src/_includes/partials/now/movies.liquid create mode 100644 src/_includes/partials/now/status.liquid create mode 100644 src/_includes/partials/now/tv.liquid diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index 30ae583b..05d25c8d 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -2,194 +2,14 @@ layout: main --- {% render "partials/header.liquid", site: site, page: page %} -

- {% heroicon "outline" "clock" "Currently" "height=28" %} -
Currently
-

-
-

- {{ status.emoji }} - {{ status.content }} -

-

- {% heroicon "outline" "map" "Map" "width=22 height=22" %} - Living in Camarillo, California with my beautiful family, 4 rescue dogs and a guinea pig. -

-

- - - NBA - - - Rooting for the Lakers (can't wait for next season with the new roster 💜💛). - -

- {{ content }} -
-

- {% heroicon "outline" "command-line" "Making" "height=28" %} -
Making
-

-
-

- - {% heroicon "outline" "code-bracket" "Hacking" "width=20 height=20" %} - - - Hacking away on projects like this page, my - blog, and whatever else I can find time for. - -

-

- {% heroicon "outline" "x-circle" "Ad and tracker-blocking" "width=20 height=20" %} - Assembling lists of ad and tracker-blocking tools. -

-
-{% if music.size > 0 %} -

- {% heroicon "outline" "microphone" "Artists" "height=28" %} -
Artists
-

-
- {% for artist in music.artists %} - -
-
-
-
{{ artist.artist }}
-
- {{ artist.plays }} plays -
-
- {%- capture artistImg %}{{ artist.artist | artist }}{% endcapture -%} - {%- capture artistName %}{{ artist.artist | escape }}{% endcapture -%} - {% image artistImg, artistName, 'rounded-lg w-full', '225px', 'eager' %} -
-
- {% endfor %} -
-{% endif %} -{% if music.size > 0 %} -

- {% heroicon "outline" "musical-note" "Albums" "height=28" %} -
Albums
-

-
- {% for album in music.albums %} - -
-
-
-
{{ album.name }}
-
- {{ album.artist }} -
-
- {%- capture albumName %}{{ album.name | escape }}{% endcapture -%} - {% image album.art, albumName, 'rounded-lg w-full h-full', '225px' %} -
-
- {% endfor %} -
-{% endif %} -{% if albumReleases.size > 0 %} -

- {% heroicon "outline" "calendar" "Anticipated albums" "height=28" %} -
Anticipated albums
-

- -{% endif %} -{% if books.size > 0 %} -

- {% heroicon "outline" "book-open" "Books" "height=28" %} -
Books
-

-
- {% for book in books %} - -
-
- {%- capture bookImg %}{{book.cover}}{% endcapture -%} - {%- capture bookName %}{{book.title | escape}}{% endcapture -%} - {% image bookImg, bookName, 'rounded-lg w-full h-full', '180px' %} -
-
- {% endfor %} -
-{% endif %} -{% if links.size > 0 %} -

- {% heroicon "outline" "link" "Links" "height=28" %} -
Links
-

- -{% endif %} -{% if movies.size > 0 %} -

- {% heroicon "outline" "film" "Movies" "height=28" %} -
Movies
-

-
- {% for movie in movies %} - -
-
-
-
{{ movie.title }}
-
- {%- 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' %} -
-
- {% endfor %} -
-{% endif %} -{% if tv.size > 0 %} -

- {% heroicon "outline" "tv" "TV" "height=28" %} -
TV
-

-
- {% for episode in tv %} - -
-
-
-
{{ episode.episode.title }}
-
- {{ episode.show.title }} • S{{ episode.episode.season }}E{{ episode.episode.number }} -
-
- {%- 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' %} -
-
- {% endfor %} -
-{% endif %} +{{ content }} +{% render "partials/now/artists.liquid", music:music %} +{% render "partials/now/albums.liquid", music:music %} +{% render "partials/now/albumReleases.liquid", albumReleases:albumReleases %} +{% render "partials/now/books.liquid", books:books %} +{% render "partials/now/links.liquid", links:links %} +{% render "partials/now/movies.liquid", movies:movies %} +{% render "partials/now/tv.liquid", tv:tv %}

This is a now page, and if you have your own site, you should make one too.

diff --git a/src/_includes/partials/now/albumReleases.liquid b/src/_includes/partials/now/albumReleases.liquid new file mode 100644 index 00000000..7a5aae5c --- /dev/null +++ b/src/_includes/partials/now/albumReleases.liquid @@ -0,0 +1,16 @@ +{% if albumReleases.size > 0 %} +

+ {% heroicon "outline" "calendar" "Anticipated albums" "height=28" %} +
Anticipated albums
+

+ +{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/albums.liquid b/src/_includes/partials/now/albums.liquid new file mode 100644 index 00000000..5890d7e0 --- /dev/null +++ b/src/_includes/partials/now/albums.liquid @@ -0,0 +1,23 @@ +{% if music.size > 0 %} +

+ {% heroicon "outline" "musical-note" "Albums" "height=28" %} +
Albums
+

+
+ {% for album in music.albums %} + +
+
+
+
{{ album.name }}
+
+ {{ album.artist }} +
+
+ {%- capture albumName %}{{ album.name | escape }}{% endcapture -%} + {% image album.art, albumName, 'rounded-lg w-full h-full', '225px' %} +
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/artists.liquid b/src/_includes/partials/now/artists.liquid new file mode 100644 index 00000000..571444ee --- /dev/null +++ b/src/_includes/partials/now/artists.liquid @@ -0,0 +1,24 @@ +{% if music.size > 0 %} +

+ {% heroicon "outline" "microphone" "Artists" "height=28" %} +
Artists
+

+
+ {% for artist in music.artists %} + +
+
+
+
{{ artist.artist }}
+
+ {{ artist.plays }} plays +
+
+ {%- capture artistImg %}{{ artist.artist | artist }}{% endcapture -%} + {%- capture artistName %}{{ artist.artist | escape }}{% endcapture -%} + {% image artistImg, artistName, 'rounded-lg w-full', '225px', 'eager' %} +
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/books.liquid b/src/_includes/partials/now/books.liquid new file mode 100644 index 00000000..9f5f61c0 --- /dev/null +++ b/src/_includes/partials/now/books.liquid @@ -0,0 +1,18 @@ +{% if books.size > 0 %} +

+ {% heroicon "outline" "book-open" "Books" "height=28" %} +
Books
+

+
+ {% for book in books %} + +
+
+ {%- capture bookImg %}{{book.cover}}{% endcapture -%} + {%- capture bookName %}{{book.title | escape}}{% endcapture -%} + {% image bookImg, bookName, 'rounded-lg w-full h-full', '180px' %} +
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/links.liquid b/src/_includes/partials/now/links.liquid new file mode 100644 index 00000000..a82266e3 --- /dev/null +++ b/src/_includes/partials/now/links.liquid @@ -0,0 +1,15 @@ +{% if links.size > 0 %} +

+ {% heroicon "outline" "link" "Links" "height=28" %} +
Links
+

+ +{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/movies.liquid b/src/_includes/partials/now/movies.liquid new file mode 100644 index 00000000..4534adbf --- /dev/null +++ b/src/_includes/partials/now/movies.liquid @@ -0,0 +1,21 @@ +{% if movies.size > 0 %} +

+ {% heroicon "outline" "film" "Movies" "height=28" %} +
Movies
+

+
+ {% for movie in movies %} + +
+
+
+
{{ movie.title }}
+
+ {%- 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' %} +
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/_includes/partials/now/status.liquid b/src/_includes/partials/now/status.liquid new file mode 100644 index 00000000..62d32475 --- /dev/null +++ b/src/_includes/partials/now/status.liquid @@ -0,0 +1,4 @@ +

+ {{ status.emoji }} + {{ status.content }} +

\ No newline at end of file diff --git a/src/_includes/partials/now/tv.liquid b/src/_includes/partials/now/tv.liquid new file mode 100644 index 00000000..91513a92 --- /dev/null +++ b/src/_includes/partials/now/tv.liquid @@ -0,0 +1,24 @@ +{% if tv.size > 0 %} +

+ {% heroicon "outline" "tv" "TV" "height=28" %} +
TV
+

+
+ {% for episode in tv %} + +
+
+
+
{{ episode.episode.title }}
+
+ {{ episode.show.title }} • S{{ episode.episode.season }}E{{ episode.episode.number }} +
+
+ {%- 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' %} +
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/src/now.html b/src/now.html index 84c55ca2..7d0868eb 100644 --- a/src/now.html +++ b/src/now.html @@ -17,3 +17,46 @@ meta: image: src: https://coryd.dev/assets/img/avatar.webp --- +

+ {% heroicon "outline" "clock" "Currently" "height=28" %} +
Currently
+

+
+ {% render "partials/now/status.liquid", status:status %} +

+ {% heroicon "outline" "map" "Map" "width=22 height=22" %} + Living in Camarillo, California with my beautiful family, 4 rescue dogs and a guinea pig. +

+

+ + + NBA + + + Rooting for the Lakers (can't wait for next season with the new roster 💜💛). + +

+
+

+ {% heroicon "outline" "command-line" "Making" "height=28" %} +
Making
+

+
+

+ + {% heroicon "outline" "code-bracket" "Hacking" "width=20 height=20" %} + + + Hacking away on projects like this page, my + blog, and whatever else I can find time for. + +

+

+ {% heroicon "outline" "x-circle" "Ad and tracker-blocking" "width=20 height=20" %} + Assembling lists of ad and tracker-blocking tools. +

+
\ No newline at end of file