chore: deduplicate permalinks; fix sitemap; organize

This commit is contained in:
Cory Dransfeldt 2024-07-15 22:52:57 -07:00
parent b40986256a
commit ae1cb3dc5e
No known key found for this signature in database
64 changed files with 94 additions and 31 deletions

156
src/includes/base.liquid Normal file
View file

@ -0,0 +1,156 @@
{%- assign fullUrl = globals.url | append: page.url -%}
{%- assign pageTitle = globals.site_name -%}
{%- if schema == 'blog' -%}
{%- assign pageTitle = post.title -%}
{%- elsif title -%}
{%- assign pageTitle = title | append: ' / ' | append: globals.site_name -%}
{%- elsif artist.name_string -%}
{%- assign pageTitle = 'Artists / ' | append: artist.name_string | append: ' / ' | append: globals.site_name -%}
{%- elsif schema == 'music-index' -%}
{%- assign pageTitle = 'Music / ' | append: globals.site_name -%}
{%- elsif schema == 'music-period' -%}
{%- assign pageTitle = 'Music / ' | append: page.title | append: globals.site_name -%}
{%- elsif genre.name -%}
{%- assign pageTitle = 'Music / ' | append: genre.name | append: ' / ' | append: globals.site_name -%}
{%- elsif book.title -%}
{%- assign pageTitle = 'Books / ' | append: book.title | append: ' / ' | append: globals.site_name -%}
{%- elsif year.value -%}
{%- assign pageTitle = ' / Books ' | prepend: year.value | append: ' / ' | append: globals.site_name -%}
{%- elsif movie.title -%}
{%- assign pageTitle = 'Movies / ' | append: movie.title -%}
{%- if movie.rating -%}
{%- assign pageTitle = pageTitle | append: ' (' | append: movie.rating | append: ')' -%}
{%- endif -%}
{%- assign pageTitle = pageTitle | append: ' / ' | append: globals.site_name -%}
{%- elsif show.title -%}
{%- assign pageTitle = 'Shows / ' | append: show.title | append: ' / ' | append: globals.site_name -%}
{%- endif -%}
{%- assign pageDescription = globals.site_description -%}
{%- if schema == 'blog' -%}
{%- assign pageDescription = post.description | markdown | strip_html -%}
{%- elsif artist.description -%}
{%- assign pageDescription = artist.description | truncate: 300 -%}
{%- elsif book.description -%}
{%- assign pageDescription = book.review | markdown | strip_html | default: book.description | truncate: 300 -%}
{%- elsif movie.description -%}
{%- assign pageDescription = movie.review | markdown | strip_html | default: movie.description | truncate: 300 -%}
{%- elsif show.description -%}
{%- assign pageDescription = show.review | markdown | strip_html | default: show.description | truncate: 300 -%}
{%- elsif genre.description -%}
{%- assign pageDescription = genre.description | markdown | strip_html | truncate: 300 -%}
{%- elsif description -%}
{%- assign pageDescription = description -%}
{%- endif -%}
{%- assign ogImage = globals.opengraph_default -%}
{%- case schema -%}
{%- when 'music' -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: page.image -%}
{%- when 'music-index' -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: music.week.artists[0].image -%}
{%- when 'artist' -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: artist.image -%}
{%- when 'genre' -%}
{%- assign sortedGenreArtists = genre.artists | sortByPlaysDescending: "total_plays" -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: sortedGenreArtists[0].image -%}
{%- when 'watching' -%}
{%- assign featuredMovie = movies.recentlyWatched | first -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: featuredMovie.backdrop -%}
{%- when 'books' -%}
{%- assign featuredBook = books.all | bookStatus: 'started' | reverse | first -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: featuredBook.image -%}
{%- when 'books-year' -%}
{%- assign featuredBook = books.all | bookStatus: 'finished' | bookFinishedYear: year.value | bookSortDescending | first -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: featuredBook.image -%}
{%- when 'book' -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: book.image -%}
{%- when 'movie' -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: movie.backdrop -%}
{%- when 'show' -%}
{%- assign ogImage = 'https://cdn.coryd.dev/shows/backdrops/backdrop-' | append: show.backdrop -%}
{%- when 'genre' -%}
{%- assign genreArtist = genre.artists | shuffleArray | first -%}
{%- assign ogImage = 'https://cdn.coryd.dev' | append: genreArtist.image -%}
{%- endcase -%}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ pageTitle }}</title>
<link rel="preload" href="/assets/fonts/MonoLisa.min.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/styles/index.css?v={% appVersion %}" type="text/css" />
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{{ pageTitle }}" />
<meta name="description" content="{{ pageDescription | escape | strip }}" />
<meta property="og:description" content="{{ pageDescription | escape | strip }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ fullUrl }}" />
<meta property="og:image" content="{{ ogImage }}?class=w800" />
<meta name="theme-color" content="{{ globals.theme_color }}" />
<meta name="fediverse:creator" content="@cory@social.lol" />
<meta name="generator" content="Eleventy">
<meta name="robots" content="noai, noimageai">
<link href="https://cdn.coryd.dev/{{ globals.favicon_ico }}?v={% appVersion %}" rel="icon" sizes="any">
<link href="https://cdn.coryd.dev/{{ globals.favicon_svg }}?v={% appVersion %}" rel="icon" type="image/svg+xml">
<link href="https://cdn.coryd.dev/{{ globals.apple_touch_icon }}?v={% appVersion %}" rel="apple-touch-icon">
<link rel="webmention" href="https://webmention.io/coryd.dev/webmention" />
<link rel="pingback" href="https://webmention.io/coryd.dev/xmlrpc" />
<link type="application/atom+xml" rel="alternate" title="{{ globals.site_name }}" href="https://feedpress.me/coryd">
<link rel="alternate" type="application/json" title="{{ globals.site_name }}" href="https://feedpress.me/coryd.json" />
<link rel="alternate" href="https://feedpress.me/coryd-links" title="{{ globals.site_name }}'s links feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-movies" title="{{ globals.site_name }}'s movies feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-books" title="{{ globals.site_name }}'s books feed" type="application/rss+xml">
<link rel="alternate" href="https://feedpress.me/coryd-all" title="{{ globals.site_name }}'s activity feed" type="application/rss+xml">
<script defer data-domain="coryd.dev" src="/js/script.outbound-links.tagged-events.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ globals.url }}#website",
"url": "{{ globals.url }}",
"name": "{{ pageTitle }}",
"description": "{{ pageDescription }}",
"inLanguage": "{{ globals.locale }}"
},
{%- if schema == 'blog' -%}
{
"@type": "BlogPosting",
"mainEntityOfPage": { "@type": "WebPage" },
"isPartOf": { "@id": "{{ globals.url }}#website" },
"@id": "{{ fullUrl }}",
"headline": "{{ pageTitle }}",
"description": "{{ pageDescription }}",
"image": "{{ image | default: globals.meta_data.opengraph_default }}",
"inLanguage": "{{ globals.locale }}",
"publisher": { "@type": "{{ globals.site_type }}", "name": "{{ globals.author }}", "url": "{{ globals.url }}" },
"author": { "@type": "Person", "name": "{{ globals.author }}" },
"datePublished": "{{ page.date | isoDateOnly: '.' }}"
}
{%- endif -%}
]
}
</script>
<noscript>
<style>.client-side {display:none}</style>
</noscript>
</head>
<body>
<script>
(() => {
const currentTheme = sessionStorage?.getItem('theme')
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches
const root = document.getElementsByTagName('html')[0]
if (!currentTheme) sessionStorage?.setItem('theme', (prefersDarkScheme ? 'dark' : 'light'))
root.classList.add(`theme__${currentTheme || (prefersDarkScheme ? 'dark' : 'light')}`)
})()
</script>
{{ content }}
</body>
</html>

View file

@ -0,0 +1,7 @@
---
layout: main
---
{% render "partials/header.liquid", globals: globals, page: page, nav: nav %}
<div class="default-wrapper">
{{ content }}
</div>

14
src/includes/main.liquid Normal file
View file

@ -0,0 +1,14 @@
---
layout: base
---
{%- capture updateTime -%}
{% if updated == "now" %}
{{ 'now' | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }}
{% elsif page.updated %}
{{ page.updated | date: "%B %-d, %l:%M %P", "America/Los_Angeles" }}
{% endif %}
{%- endcapture -%}
<div class="main-wrapper">
<main>{{ content }}</main>
{% render "partials/footer.liquid", page:page, nav:nav, updated:updateTime %}
</div>

4
src/includes/page.liquid Normal file
View file

@ -0,0 +1,4 @@
---
layout: default
---
{{ content | markdown }}

View file

@ -0,0 +1,8 @@
<div class="addon-links">
{%- if popularPosts.size > 0 -%}
<div>{% render "partials/blocks/popular-posts.liquid", popularPosts:popularPosts %}</div>
{%- endif -%}
{%- if links.size > 0 -%}
<div>{% render "partials/blocks/recent-links.liquid", links:links %}</div>
{%- endif -%}
</div>

View file

@ -0,0 +1,22 @@
<div class="avatar-wrapper flex-centered">
<div class="interior">
<img
srcset="
https://cdn.coryd.dev/{{ image }}?class=squaresm 200w,
https://cdn.coryd.dev/{{ image }}?class=squaremd 400w,
https://cdn.coryd.dev/{{ image }}?class=squarebase 800w,
https://cdn.coryd.dev/{{ image }}?class=squarelg 1200w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 1000px) 800px,
1200px"
src="https://cdn.coryd.dev/{{ image }}?class=squarelg"
alt="{{ alt }}"
loading="eager"
decoding="async"
width="600"
height="600"
/>
</div>
</div>

View file

@ -0,0 +1,18 @@
<div class="badge-grid">
{% for badge in badges limit: 8 %}
<a href="{{ badge.url }}">
<img srcset="
https://cdn.coryd.dev/{{ badge.image }}?class=w50 50w,
https://cdn.coryd.dev/{{ badge.image }}?class=w100 100w,
https://cdn.coryd.dev/{{ badge.image }}?class=w200 200w,
" sizes="(max-width: 450px) 88px,
(max-width: 850px) 176px,
(max-width: 1000px) 352px,
704px" src="https://cdn.coryd.dev/{{ badge.image }}?class=w200" alt="{{ badge.image_alt }}" loading="lazy"
decoding="async"
width="88"
height="31"
/>
</a>
{% endfor %}
</div>

View file

@ -0,0 +1,3 @@
<div class="banner error">
<p>{% tablericon "alert-circle" "Error" %}{{ text }}</p>
</div>

View file

@ -0,0 +1,3 @@
<div class="banner github">
<p>{% tablericon "brand-github" "GitHub repository" %}Take a look at <a href="{{ url }}">the GitHub repository for this project</a>. (Give it a star if you feel like it.)</p>
</div>

View file

@ -0,0 +1,3 @@
<div class="banner npm">
<p>{% tablericon "brand-npm" "NPM package" %}<a href="{{ url }}">You can take a look at this package on NPM</a> or install it by running <code>{{ command }}</code>.</p>
</div>

View file

@ -0,0 +1,6 @@
{% assign isOldPost = date | oldPost %}
{% if isOldPost %}
<div class="banner old-post">
<p>{% tablericon "clock-x" "Old post" %}This post is over 3 years old. I've probably changed my mind since it was written and it <em>could</em> be out of date.</p>
</div>
{% endif %}

View file

@ -0,0 +1,3 @@
<div class="banner rss">
<p>{% tablericon "rss" "RSS feed" %}<a href="{{ url }}">{{ text }}</a>.</p>
</div>

View file

@ -0,0 +1,3 @@
<div class="banner warning">
<p>{% tablericon "alert-triangle" "Warning" %}{{ text }}</p>
</div>

View file

@ -0,0 +1,19 @@
<img
srcset="
https://cdn.coryd.dev/{{ image }}?class=bannersm 256w,
https://cdn.coryd.dev/{{ image }}?class=bannermd 512w,
https://cdn.coryd.dev/{{ image }}?class=bannerbase 1024w,
https://cdn.coryd.dev/{{ image }}?class=bannerlg 2048w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
(max-width: 1000px) 1024px,
2048px"
src="https://cdn.coryd.dev/{{ image }}?class=bannerlg"
alt="{{ alt }}"
class="image-banner"
loading="eager"
decoding="async"
width="1080"
height="720"
/>

View file

@ -0,0 +1,19 @@
{% for block in blocks %}
{% if block.type == 'youtube_player' %}
{% render "partials/blocks/youtube-player.liquid", url:block.url %}
{% elsif block.type == 'github_banner' %}
{% render "partials/blocks/banners/github.liquid", url:block.url %}
{% elsif block.type == 'npm_banner' %}
{% render "partials/blocks/banners/npm.liquid", url:block.url, command:block.command %}
{% elsif block.type == 'rss_banner' %}
{% render "partials/blocks/banners/rss.liquid", url:block.url, text:block.text %}
{% elsif block.type == 'hero' %}
{% render "partials/blocks/hero.liquid", image:block.image.filename_disk, alt:block.alt_text %}
{% elsif block.type == 'markdown' %}
{{ block.text | markdown }}
{% elsif block.type == 'divider' %}
{{ block.markup | markdown }}
{% elsif block.type == 'addon_links' %}
{% render "partials/blocks/addon-links.liquid", popularPosts:collections.popularPosts, links:links %}
{% endif %}
{% endfor %}

View file

@ -0,0 +1,5 @@
<script type="module" src="/assets/scripts/components/api-text.js" crossorigin="anonymous"></script>
<api-text class="client-side" api-url="/api/now-playing">
<p class="loading">🎧 Loading...</p>
<p class="content"></p>
</api-text>

View file

@ -0,0 +1,15 @@
{% if popularPosts.size > 0 %}
<h3 class="flex-centered">
{% tablericon "flame" "Popular" %}
Popular posts
</h3>
<ul class="link-list">
{% for post in popularPosts limit: 5 %}
<li>
<a class="no-underline" href="{{ post.slug }}" title="{{ post.title | escape}}">
{{ post.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -0,0 +1,16 @@
{% if links.size > 0 %}
<h3 id="links" class="flex-centered">
{% tablericon "link" "Links" %}
Recent links
</h3>
<ul class="link-list">
{% for link in links limit: 5 %}
<li>
<a href="{{ link.link }}" title="{{ link.title | escape }}">
{{ link.title }}
</a>
{% if link.authors %} via <a href="{{ link.authors.url }}">{{ link.authors.name }}</a>{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -0,0 +1,3 @@
<script type="module" src="/assets/scripts/components/youtube-video-element.js"></script>
<style>youtube-video{aspect-ratio:16/9;width:100%;margin-bottom:var(--sizing-base)}</style>
<youtube-video controls src="{{ url }}"></youtube-video>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="{{ permalink | absoluteUrl: globals.url }}" rel="self" type="application/rss+xml" />
{%- assign entries = data | normalizeEntries -%}
<title>{{ title }}</title>
<description>{{ description }}</description>
<link>{{ permalink | absoluteUrl: globals.url }}</link>
<lastBuildDate>{{ updated | stringToRFC822Date }}</lastBuildDate>
<image>
<title>{{ title }}</title>
<link>{{ permalink | absoluteUrl: globals.url }}</link>
<url>https://cdn.coryd.dev/{{ globals.feed_image }}</url>
<width>144</width>
<height>144</height>
</image>
{% for entry in entries limit: 20 -%}
{% assign rating = entry.rating %}
{%- capture entryTitle -%}
{{ entry.title | escape }}
{%- if entry.authors %} via {{ entry.authors.name }}{%- endif -%}
{%- if rating %} ({{ rating }}){%- endif -%}
{%- endcapture -%}
<item>
<title>{{ entryTitle }}</title>
<link>{{ entry.url | encodeAmp }}</link>
<pubDate>{{ entry.date | stringToRFC822Date }}</pubDate>
<guid>{{ entry.url | encodeAmp }}</guid>
<description>{{ entry.excerpt | escape }}</description>
</item>
{%- endfor %}
</channel>
</rss>

View file

@ -0,0 +1,16 @@
<footer{% unless updated %} style="margin-top:var(--sizing-3xl)"{% endunless %}>
{% if updated %}
<p class="explainer text-small text-centered"><em>This page was last updated on {{ updated | strip }}.</em></p>
{% endif %}
<nav aria-label="Social icons" class="social flex-centered justify-centered text-centered">
{% for link in nav.footer_icons %}
{% render "partials/nav/linked-icon.liquid", title:link.title, url:link.permalink, icon:link.icon %}
{% endfor %}
</nav>
<nav aria-label="Secondary site navigation" class="sub-pages flex-centered justify-centered text-centered">
{% for link in nav.footer_text %}
{% render "partials/nav/link.liquid", page:page, title:link.title, url:link.permalink, icon:link.icon %}
{% if not forloop.last %}<span>/</span>{% endif %}
{% endfor %}
</nav>
</footer>

View file

@ -0,0 +1,10 @@
<section class="main-title">
<h1>
{% if page.url != '/' %}
<a href="/" tabindex="0">{{ globals.site_name }}</a>
{% else %}
{{ globals.site_name }}
{% endif %}
</h1>
{% render "partials/nav/menu.liquid", page:page, nav:nav %}
</section>

View file

@ -0,0 +1,28 @@
{%- assign posts = postData | filterByPostType: postType %}
<div class="article-widget-wrapper">
<div class="section-header-wrapper">
<h2 class="section-header posts flex-centered">
{% tablericon icon title %}
{{ title }}
</h2>
</div>
{% for post in posts %}
<article class="h-entry">
<div class="time-wrapper flex-centered">
{% tablericon "calendar-month" "Date" %}
<time class="dt-published" datetime="{{ post.date }}">
{{ post.date | date: "%B %e, %Y" }}
</time>
</div>
<a href="{{ post.slug }}">
<h3>{{ post.title }}</h3>
</a>
<span class="p-author h-card hidden">{{ globals.siteName }}</span>
<div class="p-summary hidden">{{ post.data.post_excerpt }}</div>
{{ post.description | markdown | truncate: 300 }}
</article>
{% endfor %}
{% if postType != 'featured' %}
<a class="link-icon flex-centered" href="/posts">View all posts {% tablericon "arrow-right" "View all posts" %}</a>
{% endif %}
</div>

View file

@ -0,0 +1,8 @@
{%- assign artist = artists | first -%}
{%- assign book = books | bookStatus: 'started' | reverse | first -%}
{%- assign show = tv.recentlyWatched | first -%}
<div class="home-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>{{ status.emoji }} {{ status.content }}</p>
{% render "partials/blocks/now-playing.liquid" %}
</div>

View file

@ -0,0 +1,64 @@
{% assign hidePagination = count or data.pages.size <= 1 %}
{% assign media = data.items | default: data | normalizeMedia %}
<div class="media-grid {% if shape == 'square' %}square{% else %}vertical{% endif %}">
{% for item in media limit: count | default: media.size %}
{% assign alt = item.alt | strip | escape %}
<a href="{{ item.url }}" title="{{ alt }}">
<div class="item-wrapper shadow">
<div class="meta-text">
{% if item.title %}
<div class="header">{{ item.title }}</div>
{% endif %}
{% if item.plays %}
<div class="subheader">{{ item.plays }} plays</div>
{% elsif item.subtext %}
<div class="subheader">{{ item.subtext }}</div>
{% endif %}
</div>
{% assign loadingStrategy = loading | default: 'lazy' %}
{% if shape == 'square' %}
<img
srcset="
https://cdn.coryd.dev{{ item.image }}?class=squaresm 200w,
https://cdn.coryd.dev{{ item.image }}?class=squaremd 400w,
https://cdn.coryd.dev{{ item.image }}?class=squarebase 800w,
https://cdn.coryd.dev{{ item.image }}?class=squarelg 1200w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 100px) 800px,
1200px"
src="https://cdn.coryd.dev{{ item.image }}?class=squarelg"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"
width="240"
height="240"
/>
{% else %}
<img
srcset="
https://cdn.coryd.dev{{ item.image }}?class=verticalsm 200w,
https://cdn.coryd.dev{{ item.image }}?class=verticalmd 400w,
https://cdn.coryd.dev{{ item.image }}?class=verticalbase 800w,
https://cdn.coryd.dev{{ item.image }}?class=verticallg 1200w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 1000px) 800px,
1200px"
src="https://cdn.coryd.dev{{ item.image }}?class=verticallg"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"
width="200"
height="307"
/>
{% endif %}
</div>
</a>
{% endfor %}
</div>
{% unless hidePagination %}
{% render "partials/nav/paginator.liquid", pagination:data %}
{% endunless %}

View file

@ -0,0 +1,33 @@
<div class="music-chart">
{% assign items = data.items | default: data %}
<ol type="1">
{% for item in items limit: count | default: items.size %}
{%- assign playTotal = playTotal | default: mostPlayed -%}
{%- assign percentage = item.plays | calculatePlayPercentage: playTotal -%}
<li value="{{ item.rank }}">
<div class="item">
<div class="presentation">
<div class="info">
<div class="title">
<a href="{{ item.url }}">{{ item.title }}</a>
</div>
{% capture playsLabel %}
{% if item.plays > 1 %}
plays
{% else %}
play
{% endif %}
{% endcapture %}
<div class="subtext">{{ item.artist }}</div>
<div class="subtext">{{ item.plays }} {{ playsLabel }}</div>
</div>
</div>
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
</div>
</li>
{% endfor %}
</ol>
</div>
{% unless count %}
{% render "partials/nav/paginator.liquid", pagination:data %}
{% endunless %}

View file

@ -0,0 +1,32 @@
<div class="music-chart">
{% for item in data limit: 10 %}
{% capture alt %}{{ item.title | escape }} by {{ item.artist }}{% endcapture %}
<div class="item">
<div class="meta">
<img
srcset="
https://cdn.coryd.dev{{ item.image }}?class=w50 50w,
https://cdn.coryd.dev{{ item.image }}?class=w100 100w,
https://cdn.coryd.dev{{ item.image }}?class=w200 200w,
"
sizes="(max-width: 1000px) 50px, 100px, 200px"
src="https://cdn.coryd.dev{{ item.image }}?class=w200"
alt="{{ alt }}"
loading="lazy"
decoding="async"
width="64"
height="64"
/>
<div class="meta-text">
<div class="title">
<a href="{{ item.url }}">{{ item.title }}</a>
</div>
<div class="subtext">{{ item.artist }}</div>
</div>
</div>
<div class="timestamp">
{{ item.timestamp | date: "%B %-d, %-I:%M%p", "America/Los_Angeles" }}
</div>
</div>
{% endfor %}
</div>

View file

@ -0,0 +1,5 @@
{% if percentage %}
<div class="progress-bar-wrapper" title="{{ percentage }}">
<div style="width:{{ percentage }}" class="progress-bar"></div>
</div>
{% endif %}

View file

@ -0,0 +1,48 @@
{% assign hidePagination = count or data.pages.size <= 1 %}
<div class="watching grid{% if hidePagination %} no-pagination {% endif %}">
{% assign items = data.items | default: mediaItems %}
{% for item in items limit: count %}
{% capture alt %}{{ item.title | escape }} ({{ item.year }}){% endcapture %}
<a href="{{ item.url }}">
<div class="watching item shadow">
<div class="meta-text">
{% if item.type == 'movie' %}
<div class="header">{{ item.title }}</div>
<div class="subheader flex-centered">
{{ item.year }}
{% if item.rating %}
<span class="rating"> ({{ item.rating }})</span>
{% endif %}
</div>
{% else %}
<div class="header">{{ item.name }}</div>
{% endif %}
</div>
{%- capture loadingStrategy -%}
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
{%- endcapture -%}
<img
srcset="
https://cdn.coryd.dev{{ item.backdrop }}?class=bannersm 256w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannermd 512w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannerbase 1024w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannerlg 2048w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
(max-width: 1000px) 1024px,
2048px"
src="https://cdn.coryd.dev{{ item.backdrop }}?class=bannerlg"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"
width="256"
height="170"
/>
</div>
</a>
{% endfor %}
</div>
{% unless hidePagination %}
{% render "partials/nav/paginator.liquid", pagination:data %}
{% endunless %}

View file

@ -0,0 +1,32 @@
{% capture alt %}{{ movie.title | escape }} ({{ movie.year }}){% endcapture %}
<a href="{{ movie.url }}">
<div class="watching hero shadow">
<div class="meta-text">
<div class="header">{{ movie.title }} ({{ movie.year }})</div>
<div class="subheader">
Last watched on {{ movie.dateAdded | date: "%B %e, %Y" }}
{%- if movie.rating -%}
<span class="rating">({{ movie.rating }})</span>
{%- endif -%}
</div>
</div>
<img
srcset="
https://cdn.coryd.dev{{ movie.backdrop }}?class=bannersm 256w,
https://cdn.coryd.dev{{ movie.backdrop }}?class=bannermd 512w,
https://cdn.coryd.dev{{ movie.backdrop }}?class=bannerbase 1024w,
https://cdn.coryd.dev{{ movie.backdrop }}?class=bannerlg 2048w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
(max-width: 1000px) 1024px,
2048px"
src="https://cdn.coryd.dev{{ movie.backdrop }}?class=bannerlg"
alt="{{ alt }}"
loading="eager"
decoding="async"
width="1080"
height="720"
/>
</div>
</a>

View file

@ -0,0 +1,20 @@
{%- assign categoryUrl = url | downcase -%}
{% if categoryUrl | isLinkActive: page.url %}
<span class="active {{ class }}" aria-current="page">
{% if icon %}
{% tablericon icon title %}
<span>{{ title }}</span>
{% else %}
{{ title }}
{% endif %}
</span>
{% else %}
<a class="{% if icon %}{{ icon | downcase }} icon {% endif %}{{ class }}" href="{{ categoryUrl }}" tabindex="0">
{% if icon %}
{% tablericon icon title %}
<span>{{ title }}</span>
{% else %}
{{ title }}
{% endif %}
</a>
{% endif %}

View file

@ -0,0 +1,8 @@
<a
class="{{ icon }}"
href="{{ url | downcase }}"
rel="me"
title="{{ title }}"
tabindex="0">
{% tablericon icon title %}
</a>

View file

@ -0,0 +1,17 @@
{% capture js %}
{% render "../../../assets/scripts/menu.js" %}
{% endcapture %}
<script>{{ js }}</script>
<div class="flex-centered">
<input id="menu-toggle" type="checkbox" aria-hidden="true" />
<label class="menu-button-container" for="menu-toggle" tabindex="0">
<div class="menu-closed" aria-hidden="true">{% tablericon "menu" "Menu closed" %}</div>
<div class="menu-open" aria-hidden="true">{% tablericon "x" "Menu open" %}</div>
</label>
<ul class="menu-primary" aria-label="Primary site navigation" id="primary-navigation">
{% for link in nav.primary %}
<li>{% render "partials/nav/link.liquid", page:page, title:link.title, url:link.permalink, icon:link.icon %}</li>
{% endfor %}
</ul>
{% render "partials/nav/theme-toggle.liquid" %}
</div>

View file

@ -0,0 +1,39 @@
<script type="module" src="/assets/scripts/components/select-pagination.js"></script>
<nav aria-label="Pagination" class="pagination flex-centered">
{% if pagination.href.previous %}
<a href="{{ pagination.href.previous }}" aria-label="Previous page">
{% tablericon "arrow-left" "Previous" %}
</a>
{% else %}
<span
class="disabled"
aria-label="Previous page (disabled)"
disabled>
{% tablericon "arrow-left" "Prevous" %}
</span>
{% endif %}
<select-pagination>
<select class="client-side" aria-label="Page selection">
{% for pageEntry in pagination.pages %}
<option value="{{ forloop.index | minus: 1 }}">{{ forloop.index }} of {{ pagination.links.size }}</option>
{% endfor %}
</select>
<noscript>
<div class="text-centered">
<span aria-current="page">{{ pagination.pageNumber | plus: 1 }}</span> of {{ pagination.links.size }}
</div>
</noscript>
</select-pagination>
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}" aria-label="Next page">
{% tablericon "arrow-right" "Next" %}
</a>
{% else %}
<span
class="disabled"
aria-label="Next page (disabled)"
disabled>
{% tablericon "arrow-right" "Next" %}
</span>
{% endif %}
</nav>

View file

@ -0,0 +1,13 @@
<script type="module" src="/assets/scripts/components/theme-toggle.js" crossorigin="anonymous"></script>
<span class="client-side">
<theme-toggle>
<button class="theme-toggle" tabindex="0">
<span class="light">
{% tablericon "sun" "Toggle light theme" %}
</span>
<span class="dark">
{% tablericon "moon" "Toggle dark theme" %}
</span>
</button>
</theme-toggle>
</span>

View file

@ -0,0 +1,16 @@
<div class="webring-wrapper">
<a href="https://cs.sjoy.lol">
<h3 class="text-centered">CSS JOY Webring</h3>
</a>
<div class="webring-navigation flex-centered justify-centered">
<a href="https://webri.ng/webring/cssjoy/previous?via=https://coryd.dev/webrings">
{% tablericon "arrow-left" "Previous site" %}
</a>
<a href="https://webri.ng/webring/cssjoy/random?via=https://coryd.dev/webrings">
{% tablericon "dice-3" "Random site" %}
</a>
<a href="https://webri.ng/webring/cssjoy/next?via=https://coryd.dev/webrings">
{% tablericon "arrow-right" "Next site" %}
</a>
</div>
</div>

View file

@ -0,0 +1,28 @@
<div class="webring-wrapper">
<div class="flex-centered justify-centered">
<img
srcset="
https://cdn.coryd.dev/{{ logo }}?class=w200 200w,
https://cdn.coryd.dev/{{ logo }}?class=w400 400w,
https://cdn.coryd.dev/{{ logo }}?class=w800 800w,
https://cdn.coryd.dev/{{ logo }}?class=w1600 1600w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 1000px) 800px,
1600px"
src="https://cdn.coryd.dev/{{ logo }}?class=1600"
alt="The Claw Webring"
loading="lazy"
decoding="async"
width="200"
height="169"
/>
</div>
<h3 class="text-centered">The Claw Webring</h3>
<div class="flex-centered justify-centered">
<strong>
<a class="no-underline" href="https://github.com/whitep4nth3r/the-claw-webring">Join!</a>
</strong>
</div>
</div>