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

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>