Blog

There have been 141 posts since 2019, but I've been complaining on the internet since long before then. Subscribe via RSS.

Posts tagged #web dev

‘Round here

Version 7? More like 700, given how many times I’ve redesigned a ”personal site” - still a few things to do though.

  • Like count (webmentions via comments or something?)
  • Art page
  • Figure out bluesky/etc sharing
  • Fix ^ and allow syndication without external auto post
  • Art??
  • details block: remove arrow on tablet/mobile
  • I always miss some something + something styling, in this case p + ul
  • The code block should do something lol
  • Related/recent post h3s are doing some weird text breaking (iPad/mobile?)
  • bookgraph doesn’t need to be width: 100% and shouldn’t be??
  • html background should match

April 13, 2025

Built-in cross-posting, if only I could get it to work

I've spent a few hours this evening trying to figure out how to have my posts here automatically post to Mastodon and Bluesky through the IndieConnector plugin. Mastodon was easy — it worked right away, though it did require a few tweaks to get it going exactly how I want. I have yet to push a single post through to Bluesky, though.

I keep running into a Undefined array key error but I haven't the slightest clue where it's coming from. It only comes up when I try to post to Bluesky, and despite the error coming up, I'm still able to publish posts here and on Mastodon.

It's been maddening. I'm not smart enough to figure out where this error is coming from, and it feels like it surely must be something I'm doing wrong. I just can't even figure out where to start looking.

At least while I was working on this, I was able to take care of a few other updates and tweaks around the place. Feels nice to have everything up to date.

November 09, 2024

Figured out why my RSS feed wasn't including any of the actual images from my blog. The fix requires completely changing how I handle images and manually going back and fixing all of my old posts. Yay! Web dev is so much fun, you guys!

September 11, 2024 @ 5:31PM

v 7.0.1

A few months have gone by, so obviously it was time to redesign my entire website. This version is way more simple and also slightly more complicated than the last. I did end up removing all semblance of connectivity — for now, at least, this place has no comments or likes, doesn't receive or send webmentions, and has really never heard of the indieweb.

That may come back in the future. Actually, comments and likes should definitely come back soon, but we'll see if I ever bother with webmentions again.

Buglog

I hate that I have to keep track of my own bugs that I created on my own website 🤦🏻

  • [Panel] Creating new note does not automatically set title & url anymore (thanks, Kirby 4!)
  • Need to make sure that ul and ol blocks after a paragraph get some padding
  • Really just in general, lists could get a little visual polish
  • Maybe add some kind of highlight or something for <pre> and <code> blocks
  • The social link/icons shouldn't have any padding or margin on the left
  • I had wanted to add some animation to the hover color change as well
  • Maybe the blog links on the homepage should look the same as the links on the rest of the site (text color, accent underline)
  • lol wtf is <figure> doing
  • .left-content should get a bit of padding on the right so text doesn't ever hit the line
  • No formatting in the about page bio? There should be formatting in the about page bio
  • The <title> appears to always be the site title
  • Should throw in some cache-busting, at least for the stylesheet. Which btw is also called new.css for some reason?

Update September 5, 2024

Squashed most of the bugs. Only found one more:

  • Books in the bookshelf sidebar aren't all the same size (and are too small anyway)

August 31, 2024

Always feels nice to push a new design to the website.

December 20, 2023 @ 3:14PM

I started saving pictures and videos of sunsets earlier this year with a very clear image in my head of a page where I could scroll through all of them at once. And so, I present: https://bartlett.pro/sunsets

August 22, 2023 @ 6:39PM

Tried to upgrade to Kirby 3.7 but that seems to break the Commentions plugin, which I barely got working to begin with. I'm smart enough to build a website, but not smart enough to make it fancy 😬

July 01, 2022 @ 5:54PM

Well would you look at that, I can officially tweet from my own website. "Officially" of course not meaning that it's auto-posted to Twitter, but tweet-like notes can now have a permanent home here.

June 14, 2022 @ 8:24PM

This will have to get easier

So the idea is that rather than scams of varying fungibility, the "future" of the internet (if such a thing can be quantified) ought to be everyone owning their own content à la IndieWeb. This is great! Imagine — instead of feeling like you have to create a profile on every new social media website (even though you're too old to really get TikTok), everyone just posts what they want on their own website. If someone gets really into making short, funny videos, and you want to see that, you just follow their blog, with the same RSS Reader you've always used, because there is no social media website du jour, just everyone posting from their own websites in a fully interconnected and non-siloed way.

Cool, I mean I don't see most normal people doing this, but cool, okay, I'm on board. Let's do it! What do I have to do to join this social blog-o-sphere?

I've already enabled the ability to receive and display webmentions on my posts. This feels like a big deal because while being relatively simple, it took some doing, and I had to learn quite a bit along the way. I have not yet figured out how to send webmentions out from my site if I write a post that links somewhere — in the meantime, I have to send that manually. It looks like there are some services that can take care of of this though, if I can't get the Sendmentions plugin working properly.

Ideally I'll be able to add two additional post 'types' other than these long-winded blog posts where I never get to the point. One for short little notes or updates like a tweet or a Facebook post, and one for images with descriptions, like an Instagram post. Once I can make posts like that from here, I'll probably have to manually go and download my content from the aforementioned social media websites and re-post it here. After that, it looks like I'll have to use something like Bridgy to try and pull in a backfeed from Twitter or Instagram so there might be some semblance of a 'social' aspect to this whole thing. Which, you know, is kind of the point.

Oh, then I'll have to make sure my RSS feed works properly with the new post types, if they're to be included at all.

Oh, and then I'll have to decide if I want to try and automate the process of re-posting all of this fantastic content from my website to Twitter or Instagram, because that's where real human people are still hanging out.

In enabling receiving webmentions, the Commentions plugin also adds simple comments — and I've realized now that I don't really have an effective way of replying to those comments. I'm not sure if there's a better plugin, some tweaks I can make to improve the situation, or if this is just one of those things I have to live with until I learn how to write Kirby plugins myself. I'll have to look into that.

Altogether that isn't a small amount of work, even for someone with much more knowledge in this than me. If this is meant to be the future, it's gonna have to get a heck of a lot easier. Most people think of their Facebook profile as their 'website', and until it's just as easy to get going with your own .com, I don't know how far this could possibly go.

June 10, 2022

Listing year or month only once in blog archive

A few variations of this website ago, I decided I really liked the idea of listing the posts in my blog arranged by year and month. Basically, instead of each entry having the full date (year, month, and day), I want the list of blog posts to look like this:

- 2022
    - May
        - Blog post
        - Blog post
        - Blog post
    - April
        - Blog post
    - March
        - Blog post
- 2021
    - December
        - Blog post
        - Blog post

Rather than creating loops for each year and month, I wanted to be able to just pop the year and month into separate paragraph or header tags, and only actually generate those when required — aka when it's the first time it's being listed, and no other time.

I think there might be a function in WordPress that does this automatically, but getting it to work in another CMS, including Kirby, resulted in some head-scratching at first. I'm writing this here for my future self and anyone else who wants it.

Basically, we need to take advantage of the foreach loop and some extra variables to make this work. For example, to only list the year the first time, we'll create a new variable $posted_year just before the loop, and set it to something like 0. Then, inside the loop, we'll compare that variable to the year of the current post (via another variable $post_year here) — if it does not match (eg. 0 ≠ 2022), then the year is shown. Then, still in the loop, we'll set that new variable to the year of the current post. When the function loops again, the variable is now set as the year of the previous post, so when we test if it matches the current post and it does (2022 == 2022), we just... don't post the year.

<?php
   $posted_year = 0;
   $posted_month = 0;
   foreach($page->children()->flip() as $blogpost):
      $post_year = $blogpost->date()->toDate('Y');
      $post_month = $blogpost->date()->toDate('mY');
      if($post_year != $posted_year):
         $posted_year = $post_year; ?>
         <h2><?= $posted_year ?></h2>
      <?php endif ?>
      <?php if($post_month != $posted_month):
         $posted_month = $post_month; ?>
         <h3><?= $blogpost->date()->toDate('F') ?></h3>
      <?php endif ?>
      <p><span class="date"><?= $blogpost->date()->toDate('d') ?> &mdash;</span> <a href="<?= $blogpost->url() ?>"><?= $blogpost->title() ?></a></p>
   <?php endforeach ?>

Note: for the month variable, make sure it's a unique variable year-over-year, so you never ever have to worry about some months not showing up because they match from the last post even though it's from a different year. I like the month number and year squished together: toDate('mY').

This could very well be how everyone has done this forever, or there might be a simpler way to do it that I have altogether failed to think of, but after several unfruitful Google searches, this is what I came up with and it works a treat.

May 31, 2022