Blog

#notes

The latest updates to the site include:

  • Logo mark
  • Popular tags for each month in the Archive
  • Dark mode
  • Expand button in lists for longer posts
  • Buy Me a Coffee buttons

Small changes here and there on the worry stone. This site feels better than any previous version.

“Do we have time for a y-o-r-t-s?” my wife asks to avoid the kids understanding us.
“Yorts?” I respond.
“Backwards.”
“Stroy,” I respond.
“I suck at this.”

And this brings us to “stroy,” which is the opposite of “destroy,” right? So if destroy means to break, stroy has to mean to build. Etymology time!

Middle English, from Anglo-French destroy-, destrui-, stem of destrure, from Vulgar Latin *destrugere, alteration of Latin destruere, from de- + struere to build

Merriam-Webster

So there you go. Go forth and stroy!

Nothing too big, but I tweaked the “Other Posts You May Enjoy” section to sort by number of matches, not just date. Before it found all posts with one or more of the current post’s tags, but didn’t change the default order of reverse chronological. Now it sorts by number of similar tags, then date. So a post with 3 matches from last year will rank higher than a post with 2 from last week. Nothing ground breaking, but hopefully will help surface more relevant posts.

export async function getSimilarPosts (post: CollectionEntry<'posts'>): Promise<CollectionEntry<'posts'>[]> {
	const excludedTags = ['notes', 'links', 'featured', 'videos', 'quotes']
	const similarTags = post.data.tags.filter(tag => !excludedTags.includes(tag))

	return (
		(await getPosts(filteredPost => (
			filteredPost.slug !== post.slug &&
      filteredPost.data.tags.filter(tag => similarTags.includes(tag)).length > 0
		))).map(post => ({
			...post,
			similarTagCount: post.data.tags.filter(tag => similarTags.includes(tag)).length
		})).sort((a, b) => {
			if (a.similarTagCount > b.similarTagCount) return -1
			if (b.similarTagCount > a.similarTagCount) return 1

			if (a.data.pubDate > b.data.pubDate) return -1
			if (a.data.pubDate < b.data.pubDate) return 1

			return 0
		})
	)
}

Amazing to see the React crowd come around to realize that SSRs and Island Architecture leads to faster applications and better UX. Y’all just reinvented PHP with a bit of jQuery sprinkled in.

That’s fine, but while you are recognizing this, please stop using terms like monolith and calling React “modern” while also calling PHP + progressive enhancement not.

I added a new type of post called reposts. In my Article component— used to render each article in multiple modes (eg. list, full, snippet)— I already include all tags as classes. I use this in lists to add the icons— look at the Ramblin’ section of the homepage.

<article data-mode={mode} data-draft={draft} class={`b--post ${tags.map(tag => `tag-${tag}`).join(' ')}`}>
[...]
</article>

So adding a new post type is just a tag. With the class tag-repost, I can now add the icon. But I also wanted to show the original post embedded. To do this, I added an optional string called originalPostSlug to my Content Collection. And this gets added to the Article component.

---
let originalPost: CollectionEntry<'posts'> | undefined = undefined
if (originalPostSlug) {
	originalPost = (await getCollection('posts')).find(post => post.slug === originalPostSlug)
}
---

Now I have the original article. So now we display it after the content.

<div class="b--post--content">
  <Content />
  {
    originalPostSlug && originalPostSlug && (
      <div class="b--post--repost">
        <Article post={originalPost} mode="list" />
      </div>
    )
  }
</div>

You can see it in action here.

Sometimes I swing my flimsy sword at the throats of dragons and have the audacity to think my half-hearted thrust mattered in their fall whilst ignoring the Lion’s roaring bellow behind me.

Let me not claim victories that do not belong to me. Let me recognize the power of God, for I am but a jar of clay.

Working on SEO, Twitter Cards, and Open Graph enhancements for “Finley, I am.” this morning. Minor behind the scenes things that will make sharing better. Last night I added a similar articles section to article pages to help surface things you may also like.

While I’m getting back into blogging after a couple year dry spell, there are posts on here going back 7+ years.

I love how easy it was to implement this in Astro while not worrying about the impact on the UX, since it is all generated at build time.

Small tweaks here and there. Added a section on article pages with other posts link the one you are reading. Using tags, I query posts with the tags for the current post and return the top latest few. Nothing complicated. But could help you find something good to read.

And then they say that we are the divisive ones.

He Gets Us

They went and opened the Super Bowl not with the National Anthem, but the Black National Anthem. Not a song about unity, but a song about division. But the He Gets Us campaigns are divisive. Sure.

Well, I mentioned yesterday that the pinned articles section on the homepage was not permanent. It lasted a day. The homepage is now split, showing featured articles more prominantly and everything else in a stream of ramblin’ on the right. Added icons for the different post types there too and updated a bunch of older posts’ tags.

Something something worry stone, fiddling, etc. I love having my personal site back.