feat: recent activity

This commit is contained in:
Cory Dransfeldt 2024-09-18 19:32:26 -07:00
parent d36f589bdf
commit 6055a00193
No known key found for this signature in database
12 changed files with 85 additions and 64 deletions

View file

@ -0,0 +1,17 @@
{%- assign track = music.week.tracks | first -%}
{%- assign show = tv.recentlyWatched | first -%}
{%- assign movie = movies.recentlyWatched | first -%}
{%- assign book = books | bookStatus: 'finished' | bookSortDescending | first -%}
{%- assign link = links | first -%}
<h2 class="section-header">
{% tablericon "activity" "Recent activity" %}
Recent activity
</h2>
<ul>
<li class="music">Top track this week: <a href="{{ track.url }}">{{ track.title }} by {{ track.artist }}</a></li>
<li class="tv">Last episode watched: <strong class="highlight-text">S{{ show.season }}E{{ show.episode }}</strong> of <a href="{{ show.url }}">{{ show.name }}</a></li>
<li class="movies">Last movie watched: <a href="{{ movie.url }}">{{ movie.title }}</a>{%- if movie.rating %} ({{ movie.rating }}){%- endif -%}</li>
<li class="books">Last book finished: <a href="{{ book.url }}">{{ book.title }}</a> by {{ book.author }}{%- if book.rating %} ({{ book.rating }}){%- endif -%}</li>
<li class="link">Last link shared: <a href="{{ link.link }}">{{ link.title }}</a>{% if link.authors %} via <a href="{{ link.authors.url }}">{{ link.authors.name }}</a>{% endif %}</li>
</ul>
{% render "partials/blocks/banners/rss.liquid", url: "/feeds", text: "Subscribe to my movies, books, links or activity feed(s)" %}

View file

@ -1,14 +1,14 @@
{%- assign posts = postData | filterByPostType: postType %}
<div class="article-widget-wrapper">
<div class="section-header-wrapper">
<h2 class="section-header posts">
{% tablericon icon title %}
{{ title }}
<h2 class="section-header">
{% tablericon "clock" "Recent posts" %}
Recent posts
</h2>
</div>
{%- for post in posts -%}
{%- for post in posts limit: 5 -%}
<article>
<time datetime="{{ post.date }}">
{%- if post.featured -%}{% tablericon "star" "featured" %}{%- endif -%}
{{ post.date | date: "%B %e, %Y" }}
</time>
<h3>
@ -17,7 +17,5 @@
{{ post.description | normalize_whitespace | markdown | truncatewords: 50 }}
</article>
{%- endfor -%}
{%- if postType != 'featured' -%}
<a class="icon-link" href="/posts">View all posts {% tablericon "arrow-right" "View all posts" %}</a>
{%- endif -%}
<a class="icon-link" href="/posts">View all posts {% tablericon "arrow-right" "View all posts" %}</a>
</div>

View file

@ -1,7 +1,6 @@
{%- assign artist = music.week.artists | first -%}
{%- assign book = books | bookStatus: 'started' | reverse | first -%}
{%- assign show = tv.recentlyWatched | first -%}
<article class="status">
<p><strong class="highlight-text">I'm a software developer based in Camarillo, California</strong>. I enjoy hanging out with my beautiful family and 3 rescue dogs, technology, automation, <a href="/music">music</a>, <a href="/posts">writing</a>, <a href="/books">reading</a>, <a href="/watching#tv">tv</a> and <a href="/watching#movies">movies</a>. Lately I've been listening to a lot of <strong class="highlight-text">{{ artist.title }}</strong>, reading <strong class="highlight-text">{{ book.title }}</strong> and watching <strong class="highlight-text">{{ show.name }}</strong>.</p>
<p><strong class="highlight-text">I'm a software developer based in Camarillo, California</strong>. I enjoy hanging out with my beautiful family and 3 rescue dogs, technology, automation, <a href="/music">music</a>, <a href="/posts">writing</a>, <a href="/books">reading</a>, <a href="/watching#tv">tv</a> and <a href="/watching#movies">movies</a>.</p>
{% render "partials/blocks/now-playing.liquid", music:music %}
<hr />
{% render "partials/home/recent-activity.liquid" music:music, books:books, tv:tv, movies:movies, links:links %}
</article>