From 0ccc749cd894c3c03d3a2dbc006f70e635aa3489 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 10 May 2025 08:01:47 -0700 Subject: [PATCH] chore: reorganize home page to put media + activity in single section --- package-lock.json | 4 +- package.json | 2 +- src/includes/home/recent-activity.liquid | 114 +++++++++++------------ src/includes/home/recent-media.liquid | 37 +++----- src/pages/index.html | 20 ++-- 5 files changed, 85 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8acb40d..1cd4ead 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "3.7.4", + "version": "3.8.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "3.7.4", + "version": "3.8.4", "license": "MIT", "dependencies": { "html-minifier-terser": "7.2.0", diff --git a/package.json b/package.json index d1df8c2..de40494 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "3.7.4", + "version": "3.8.4", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "engines": { diff --git a/src/includes/home/recent-activity.liquid b/src/includes/home/recent-activity.liquid index 3825fec..bc0731b 100644 --- a/src/includes/home/recent-activity.liquid +++ b/src/includes/home/recent-activity.liquid @@ -1,62 +1,56 @@ -
-

- {% tablericon "activity" %} - Recent activity -

- {%- for item in items -%} -
- -

- {%- if item.type == "concerts" -%} - {%- capture artistName -%} - {%- if item.artist_url -%} - {{ item.title | split: ' at ' | first }} - {%- else -%} - {{ item.title | split: ' at ' | first }} - {%- endif -%} - {%- endcapture -%} - {%- capture venue -%} - {%- if item.venue_lat and item.venue_lon -%} - {{ item.venue_name }} - {%- else -%} - {{ item.venue_name }} - {%- endif -%} - {%- endcapture -%} - {{ artistName }} - {% if venue %} at {{ venue }}{% endif %} - {%- else -%} - {{ item.title }} - {%- if item.type == "link" and item.author -%} - via - {%- if item.author.url -%} - {{ item.author.name }} - {%- else -%} - {{ item.author.name }} - {%- endif -%} - {%- endif -%} - {%- endif -%} -

- {% render "blocks/tags.liquid", - tags:item.tags +{%- for item in items -%} +
+
- {%- endfor -%} + {%- endif -%} + +

+ {%- if item.type == "concerts" -%} + {%- capture artistName -%} + {%- if item.artist_url -%} + {{ item.title | split: ' at ' | first }} + {%- else -%} + {{ item.title | split: ' at ' | first }} + {%- endif -%} + {%- endcapture -%} + {%- capture venue -%} + {%- if item.venue_lat and item.venue_lon -%} + {{ item.venue_name }} + {%- else -%} + {{ item.venue_name }} + {%- endif -%} + {%- endcapture -%} + {{ artistName }} + {% if venue %} at {{ venue }}{% endif %} + {%- else -%} + {{ item.title }} + {%- if item.type == "link" and item.author -%} + via + {%- if item.author.url -%} + {{ item.author.name }} + {%- else -%} + {{ item.author.name }} + {%- endif -%} + {%- endif -%} + {%- endif -%} +

+ {% render "blocks/tags.liquid", + tags:item.tags + %}
+{%- endfor -%} diff --git a/src/includes/home/recent-media.liquid b/src/includes/home/recent-media.liquid index 3ae6345..46c1011 100644 --- a/src/includes/home/recent-media.liquid +++ b/src/includes/home/recent-media.liquid @@ -1,22 +1,15 @@ -
-

- {% tablericon "activity" %} - Recent media -

-

My top artists, albums, recently read books, watched movies and shows. A living snapshot, if you will.

- {% render "media/grid.liquid", - globals:globals, - data:media.recentMusic, - loading:"eager" - %} - {% render "media/grid.liquid", - globals:globals, - data:media.recentWatchedRead, - shape:"vertical", - loading:"eager" - %} - {% render "blocks/banners/rss.liquid", - url:"/feeds", - text:"Subscribe to my movies, books, links or activity feed(s)" - %} -
+{% render "media/grid.liquid", + globals:globals, + data:media.recentMusic, + loading:"eager" +%} +{% render "media/grid.liquid", + globals:globals, + data:media.recentWatchedRead, + shape:"vertical", + loading:"eager" +%} +{% render "blocks/banners/rss.liquid", + url:"/feeds", + text:"Subscribe to my posts, movies, books, links or activity feed(s)" +%} diff --git a/src/pages/index.html b/src/pages/index.html index 6ca1b8e..aeed349 100644 --- a/src/pages/index.html +++ b/src/pages/index.html @@ -6,10 +6,16 @@ updated: "now" intro:globals.intro, nowPlaying:nowPlaying.content %} -{% render "home/recent-media.liquid" - media:recentMedia, - globals:globals -%} -{% render "home/recent-activity.liquid" - items:recentActivity -%} +
+

+ {% tablericon "activity" %} + Recent activity +

+ {% render "home/recent-media.liquid" + media:recentMedia, + globals:globals + %} + {% render "home/recent-activity.liquid" + items:recentActivity + %} +