chore: cleanup and refactor

This commit is contained in:
Cory Dransfeldt 2023-12-11 11:00:39 -08:00
parent b6fb54ab98
commit 5295a6eacc
No known key found for this signature in database
37 changed files with 285 additions and 356 deletions

16
src/_data/meta.js Normal file
View file

@ -0,0 +1,16 @@
module.exports = {
siteName: 'Cory Dransfeldt',
siteDescription:
"I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.",
author: 'Cory Dransfeldt',
authorEmail: 'cory.dransfeldt@gmail.com',
authorWebsite: 'https://coryd.dev',
themeColor: '#3b82f6',
url: process.env.URL || 'http://localhost:8080',
siteType: 'Person',
locale: 'en_US',
lang: 'en',
meta_data: {
opengraph_default: 'https://coryd.dev/assets/img/logo.webp',
},
}

View file

@ -1,11 +0,0 @@
module.exports = async function () {
return {
name: 'Cory Dransfeldt',
email: 'cory.dransfeldt@gmail.com',
url: 'https://coryd.dev',
logo: 'https://coryd.dev/assets/img/logo.webp',
title: 'Cory Dransfeldt',
description:
"I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.",
}
}

View file

@ -1,5 +1,5 @@
{%- capture fullUrl %}
{{ site.url }}{{ page.url }}{% endcapture -%}
{{ meta.url }}{{ page.url }}{% endcapture -%}
<!doctype html>
<html class="scrollbar-thin scrollbar-thumb-blue-600 dark:scrollbar-thumb-blue-400 scrollbar-track-blue-100" lang="en">
<head>
@ -7,17 +7,17 @@
{% if title %}
{{ title }} •
{% endif %}
{{ site.title }}</title>
{{ meta.siteName }}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="{{ fullUrl }}" />
<meta property="og:title" content="{% if title %}{{ title }} • {% endif %}{{site.title}}" />
<meta name="description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ site.description }}{% endif %}" />
<meta property="og:description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ site.description }}{% endif %}" />
<meta property="og:title" content="{% if title %}{{ title }} • {% endif %}{{meta.title}}" />
<meta name="description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ meta.siteDescription }}{% endif %}" />
<meta property="og:description" content="{% if excerpt %}{{ excerpt}}{% else %}{{ meta.siteDescription }}{% endif %}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ fullUrl }}" />
<meta property="og:image" content="{{ image | getPostImage }}">
<meta name="theme-color" content="#3b82f6" />
<meta name="theme-color" content="{{ meta.themeColor }}" />
<meta name="generator" content="{{ eleventy.generator }}">
<meta name="robots" content="noai, noimageai">
<link
@ -55,9 +55,11 @@
href="https://feedpress.me/coryd-follow"
title="Cory Dransfeldt's activity feed"
type="application/rss+xml">
<script type="application/ld+json">
{% jsonLd meta, type, tags %}
</script>
{% if schema == 'blog' %}
{% render "schemas/blogpost-schema.liquid", meta: meta, page: page %}
{% else %}
{% render "schemas/base-schema.liquid", meta: meta, page: page %}
{% endif %}
<script defer data-domain="coryd.dev" src="/js/script.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<noscript>

View file

@ -1,7 +1,7 @@
---
layout: main
---
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
<div class="pt-8 prose dark:prose-invert hover:prose-a:text-blue-800 dark:hover:prose-a:text-blue-200 max-w-full">
{{ content }}
</div>

View file

@ -1,7 +1,7 @@
---
layout: main
---
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
{{ content }}
{% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %}
{% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8 %}

View file

@ -1,9 +1,9 @@
<div class="mt-12 py-8 border-t-2 flex flex-col md:flex-row justify-between items-center">
<div class="flex flex-col mb-4 md:mb-0 md:flex-row items-center flex-1">
<div class="border border-blue-600 dark:border-blue-400 bg-white rounded-full overflow-hidden mb-4 md:mb-0 md:mr-4 [&>*]:h-20 [&>*]:w-20 flex flex-col items-center">
{% image './src/assets/img/avatar.webp', site.name, 'inline-block' %}
{% image './src/assets/img/avatar.webp', meta.siteName, 'inline-block' %}
</div>
<span class="text-lg font-medium">{{ site.name }}</span>
<span class="text-lg font-medium">{{ meta.siteName }}</span>
</div>
<p class="text-sm flex-1">{{ site.description }}</p>
<p class="text-sm flex-1">{{ meta.siteDescription }}</p>
</div>

View file

@ -3,8 +3,8 @@
"version": "https://jsonfeed.org/version/1",
"title": "{{ title }}",
"icon": "https://coryd.dev/static/images/avatar.webp",
"home_page_url": "{{ site.url }}",
"feed_url": "{{ site.url }}{{ permalink }}",
"home_page_url": "{{ meta.url }}",
"feed_url": "{{ meta.url }}{{ permalink }}",
"items": [{% for entry in entries limit: 20 -%}
{
"id": "{{ entry.url | btoa }}",

View file

@ -4,12 +4,12 @@
{% assign entries = data | normalizeEntries -%}
<title>{{ title }}</title>
<description>{{ description }}</description>
<link>{{ permalink | absoluteUrl: site.url }}</link>
<link>{{ permalink | absoluteUrl: meta.url }}</link>
<lastBuildDate>{{ updated }}</lastBuildDate>
<image>
<title>{{ title }}</title>
<link>{{ permalink | absoluteUrl: site.url }}</link>
<url>{{ site.url }}/assets/icons/feed-icon.png</url>
<link>{{ permalink | absoluteUrl: meta.url }}</link>
<url>{{ meta.url }}/assets/icons/feed-icon.png</url>
<width>144</width>
<height>144</height>
</image>

View file

@ -1,6 +1,6 @@
<div class="flex flex-col md:flex-row md:items-center md:justify-between pt-5 md:pt-10">
<h1 class="text-2xl md:text-3xl font-black leading-tight pb-5 md:pb-0">
<a class="text-gray-700 dark:text-gray-200" href="/">{{ site.title }}</a>
<a class="text-gray-700 dark:text-gray-200" href="/">{{ meta.siteName }}</a>
</h1>
{% render "partials/nav/menu.liquid", page: page, nav: nav %}
</div>

View file

@ -1,7 +1,8 @@
---
layout: main
schema: blog
---
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
<article class="h-entry" data-pagefind-body>
{% if link %}
<a class="no-underline" href="{{ link }}">
@ -13,7 +14,7 @@ layout: main
{% else %}
<h2 class="p-name text-xl md:text-2xl font-black leading-tight dark:text-gray-200 pt-8" data-pagefind-meta="title">{{ title }}</h2>
{% endif %}
<span class="p-author h-card hidden">{{ site.title }}</span>
<span class="p-author h-card hidden">{{ meta.author }}</span>
<time class="mt-2 mb-6 block text-sm dt-published" datetime="{{ date }}">{{ date | readableDate }}</time>
<div class="p-summary hidden">{{ post_excerpt | markdown }}</div>
<div class="e-content prose dark:prose-invert hover:prose-a:text-blue-800 dark:hover:prose-a:text-blue-200 max-w-full text-gray-800 dark:text-white">
@ -22,5 +23,5 @@ layout: main
</article>
{% render "partials/post-tags.liquid", tags: tags %}
{% render "partials/webmentions/container.liquid", webmentions: webmentions, page: page %}
{% render "partials/author.liquid", site: site %}
{% render "partials/author.liquid", meta: meta %}
{% render "partials/popular-posts.liquid", posts: collections.posts, analytics: analytics %}

View file

@ -0,0 +1,15 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "{{ meta.url }}#website",
"url": "{{ meta.url }}",
"name": "{{ meta.siteName }}",
"description": "{{ meta.siteDescription }}",
"inLanguage": "{{ meta.locale }}"
}
]
}
</script>

View file

@ -0,0 +1,27 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage"
},
"isPartOf": {
"@id": "{{ meta.url }}#website"
},
"@id": "{{ page.url }}",
"headline": "{{ page.title or meta.siteName }}",
"description": "{% if page.description %}{{ page.description }}{% else %}{{ meta.siteDescription }}{% endif %}",
"image": "{% if page.image %}{{ page.image }}{% else %}{{ meta.meta_data.opengraph_default }}{% endif %}",
"inLanguage": "{{ meta.locale }}",
"publisher": {
"@type": "{{ meta.siteType }}",
"name": "{{ meta.author }}",
"url": "{{ meta.url }}"
},
"author": {
"@type": "Person",
"name": "{{ meta.author }}"
},
"datePublished": "{{ page.date | isoDateOnly }}"
}
</script>

View file

@ -41,7 +41,7 @@ meta:
</h2>
{% endif %}
</a>
<span class="p-author h-card hidden">{{ site.title }}</span>
<span class="p-author h-card hidden">{{ meta.siteName }}</span>
<div class="my-2 text-sm">
<time class="dt-published" datetime="{{ post.date }}">
{{ post.date | date: "%m.%Y" }} {% if post.data.link %} • <a class="flex-none font-normal no-underline" href="{{ post.url }}">Permalink</a>{% endif %}

View file

@ -1,7 +1,7 @@
---
title: '404'
title: 404
layout: default
permalink: 404.html
permalink: /404.html
---
{% image './src/assets/img/404.jpg', title, 'border border-blue-600 dark:border-blue-400 rounded-lg overflow-hidden [&>*]:w-full' %}

View file

@ -1,26 +1,12 @@
---
layout: default
title: About
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • About'
description: 'Husband, dad, developer, music nerd.'
url: https://coryd.dev/about
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: default
permalink: /about.html
---
<div class="flex items-center justify-center w-full not-prose mb-6">
<div class="border border-blue-600 dark:border-blue-400 bg-white rounded-full overflow-hidden p-4 w-64 h-64 md:w-96 md:h-96 flex items-center [&>*]:w-full [&>*]:h-auto">
{% capture about_alt %}{{ site.name }} - image by David Neal / @reverentgeek{% endcapture %}
{% capture about_alt %}{{ meta.siteName }} - image by David Neal / @reverentgeek{% endcapture %}
{% image './src/assets/img/avatar.webp', about_alt %}
</div>
</div>

View file

@ -1,21 +1,8 @@
---
layout: default
title: Blogroll
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Blogroll'
description: 'These are awesome blogs that I enjoy and you may enjoy too.'
url: https://coryd.dev/blogroll
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: default
permalink: /blogroll.html
description: 'These are awesome blogs that I enjoy and you may enjoy too.'
---
<h2

View file

@ -1,7 +1,7 @@
---
title: 'Success'
title: Success
layout: default
permalink: contact/success.html
permalink: /contact/success.html
---
<div class="text-center w-full">

View file

@ -1,21 +1,8 @@
---
layout: default
title: Contact
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Contact'
description: 'How to contact me.'
url: https://coryd.dev/contact
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: default
permalink: /contact.html
description: 'How to contact me.'
---
<h2
@ -30,7 +17,7 @@ meta:
<ul>
<li>Ping me on <a href="https://social.lol/@cory">Mastodon</a></li>
<li>Message me on Signal or iMessage (if you have my phone number)</li>
<li><a href="mailto:{{ site.email }}">Email me directly</a> if you have a client set up to use <code>mailto:</code> links</li>
<li><a href="mailto:{{ meta.authorEmail }}">Email me directly</a> if you have a client set up to use <code>mailto:</code> links</li>
<li>File an issue on the appropriate repo over at <a href="https://github.com/cdransf">GitHub</a></li>
</ul>
</div>

View file

@ -1,21 +1,8 @@
---
layout: default
title: Feeds
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Feeds'
description: 'Content feeds exposed by and generated from my site.'
url: https://coryd.dev/feeds
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: default
permalink: /feeds.html
description: 'Content feeds exposed by and generated from my site.'
---
<h2

View file

@ -1,21 +1,8 @@
---
layout: now
title: Now
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Now'
description: "See what I'm doing now."
url: https://coryd.dev/now
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: now
permalink: /now.html
description: "See what I'm doing now."
---
<h2 class="[&>svg]:h-5 [&>svg]:w-5 [&>svg]:md:h-7 [&>svg]:md:w-7 [&>svg]:-mt-1 [&>svg]:md:-mt-1.5 [&>svg]:inline icon--bold m-0 text-xl font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mt-8 mb-4">
{% tablericon "clock-heart" "Currently" %}

View file

@ -1,21 +1,8 @@
---
layout: default
title: Referrals
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Referrals'
description: 'Referral links for services that I use.'
url: https://coryd.dev/referrals
image:
src: https://coryd.dev/assets/img/avatar.webp
layout: default
permalink: /referrals.html
description: 'Referral links for services that I use.'
---
<h2

View file

@ -1,21 +1,7 @@
---
title: /Search
layout: default
title: Search
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Search'
description: "Search everything I've posted on my site."
url: https://coryd.dev/search
image:
src: https://coryd.dev/assets/img/avatar.webp
permalink: /search.html
---
<link href="https://coryd.dev/pagefind/pagefind-ui.css" rel="stylesheet" />
@ -37,12 +23,12 @@ meta:
}
}
</style>
<div id="search" class="search"></div>
<div id="/search" class="/search"></div>
<script
src="https://coryd.dev/_pagefind/pagefind-ui.js"
onload="new PagefindUI({ element: '#search', showImages: false, processTerm: (term) => {
onload="new PagefindUI({ element: '#/search', showImages: false, processTerm: (term) => {
try{
plausible('Search', {props: {method: 'Text', term}});
plausible('/Search', {props: {method: 'Text', term}});
} catch(e){};
return term;
}

View file

@ -6,7 +6,7 @@ eleventyExcludeFromCollections: true
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in collections.all %}
<url>
<loc>{{ site.url }}{{ page.url | url }}</loc>
<loc>{{ meta.url }}{{ page.url | url }}</loc>
<lastmod>{{ page.date }}</lastmod>
<changefreq>{{page.data.changeFreq}}</changefreq>
</url>

14
src/pages/tags.md Normal file
View file

@ -0,0 +1,14 @@
---
title: Tags
layout: default
permalink: /tags.html
---
{% for tag in collections.tagList %}
<span>
<a href="/tags/{{ tag }}" class="!no-underline">
<button class="pill--button">
{{ tag }}
</button>
</a>
</span>
{% endfor %}

View file

@ -1,21 +1,9 @@
---
layout: default
title: Uses
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Uses'
description: 'Software, tools and services that I use regularly.'
url: https://coryd.dev/uses
image:
src: https://coryd.dev/assets/img/pages/uses.jpg
layout: default
permalink: /uses.html
description: 'Software, tools and services that I use regularly.'
image: https://coryd.dev/assets/img/pages/uses.jpg
---
<h2

18
src/pages/webrings.md Normal file
View file

@ -0,0 +1,18 @@
---
title: Webrings
layout: default
permalink: /webrings.html
description: "Webrings are awesome! These are the ones I'm a member of."
---
<h2
class="m-0 text-xl font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mb-2"
>
{{ title }}
</h2>
[Webrings](https://en.wikipedia.org/wiki/Webring) are _awesome_. I'm a member of a few that follow. Check them out!
{% render "webrings/the-claw.liquid" %}
<hr />
{% render "webrings/css-joy.liquid" %}

View file

@ -132,7 +132,7 @@ We use the [liquid.js render tag](https://liquidjs.com/tags/render.html) and pas
---
layout: main
---
{% render "partials/header.liquid", site: site, page: page, nav: nav %}
{% render "partials/header.liquid", meta: meta, page: page, nav: nav %}
{{ content }}
{% render "partials/now/media-grid.liquid", data:artists, icon: "microphone-2", title: "Artists", shape: "square", count: 8, loading: 'eager' %}
{% render "partials/now/media-grid.liquid", data:albums, icon: "vinyl", title: "Albums", shape: "square", count: 8, loading: 'lazy' %}

View file

@ -3,7 +3,7 @@ date: '2023-02-17'
title: 'Workflows: handling inbound email on Fastmail with regular expressions (now featuring ChatGPT)'
draft: false
tags: ['Email', 'Fastmail', 'regular expressions', 'workflows', 'ChatGPT']
image: /assets/img/og/fastmail-workflow.webp
image: https://cdn.coryd.dev/blog/fastmail-workflow.jpg
---
I've been using Fastmail for years now and have explored a number of different approaches to handling mail. I've approached it by creating rules targeting lists of top level domains, I've gone with no rules at all and a heavy-handed approach to unsubscribing from messages (operating under the idea that _everything_ warrants being seen and triaged) and I've even used HEY.<!-- excerpt -->[^1]

View file

@ -1,32 +0,0 @@
const { getPostImage } = require('../../config/filters')
const md = require('markdown-it')()
const striptags = require('striptags')
module.exports = {
eleventyComputed: {
meta: {
site: {
name: 'Cory Dransfeldt',
description:
"I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.",
url: 'https://coryd.dev',
logo: {
src: 'https://coryd.dev/assets/img/logo.webp',
width: 2000,
height: 2000,
},
},
language: 'en-US',
title: (data) => data.title,
description: (data) => striptags(md.render(data.post_excerpt)),
url: (data) => data.url,
image: {
src: (data) => data.image | getPostImage,
},
author: {
name: 'Cory Dransfeldt',
},
published: (data) => data.date,
},
},
}

View file

@ -1,28 +0,0 @@
---
layout: default
title: Tags
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Tags'
description: 'Browse all of my posts by tag.'
url: https://coryd.dev/tags
image:
src: https://coryd.dev/assets/img/avatar.webp
---
{% for tag in collections.tagList %}
<span>
<a href="/tags/{{ tag }}" class="!no-underline">
<button class="pill--button">
{{ tag }}
</button>
</a>
</span>
{% endfor %}

View file

@ -1,31 +0,0 @@
---
layout: default
title: Webrings
meta:
site:
name: 'Cory Dransfeldt'
description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies."
url: https://coryd.dev
logo:
src: https://coryd.dev/assets/img/logo.webp
width: 2000
height: 2000
language: en-US
title: 'Cory Dransfeldt • Webrings'
description: 'Content feeds exposed by and generated from my site.'
url: https://coryd.dev/webrings
image:
src: https://coryd.dev/assets/img/avatar.webp
---
<h2
class="m-0 text-xl font-black leading-tight tracking-normal dark:text-gray-200 md:text-2xl mb-2"
>
{{ title }}
</h2>
[Webrings](https://en.wikipedia.org/wiki/Webring) are _awesome_. I'm a member of a few that follow. Check them out!
{% render "webrings/the-claw.liquid" %}
<hr />
{% render "webrings/css-joy.liquid" %}