July 13, 2019

How my editor looks is important to me

This post at irreal laments the fact that people make such a big deal out of how their text editor looks, suggesting that it’s only the functionality that matters.

He quotes Vivak Halder

why should you ever care how your editor looks, unless you’re trying to win a screenshot competition?”

In general, I agree. What my editor can do and how it does it is what’s most important.

But there’s an easy answer to Vivak’s question: I care about how my editor looks because I stare at it all day. How could I not care deeply about how it looks?

There are many great reasons to defend Emacs, but appearance isn’t one of them. Dismissing aesthetics as unnecessary feels like defensive rationalization.

I’ve spent many hours trying to improve the look and feel of my Emacs experience, and I’ve gotten it to the point where, while no one would call it beautiful, it’s at least no longer aesthetically offensive.

I want the things I use and stare at all day to be pleasant. Emacs doesn’t need to be beautiful, but it does need to be nice.

Now, if I could only find a decent font and a light theme I don’t hate1.

  1. Please don’t say Leuven”. I would try and make my own theme but I doubt I could come up with anything I like, even if I was capable of making one.

July 12, 2019

Sticking with Dropbox

It’s fashionable lately to ditch” Dropbox for other sync services. The reasons stated are usually around cost or privacy. This is understandable, but for anyone with a significant number of files and/or services using Dropbox, the time and complexity of switching could easily be costlier than what it would be to just continue using Dropbox.

Dropbox has only rarely caused me grief, and only with resource usage. Sometimes the client takes too many of them. Otherwise, it’s been reliable and dependable for many years.

I’ve used Syncthing and Resilio Sync as alternatives. Both are fine, but other services depending on sync don’t often support them, meaning I still need to use Dropbox for some of my stuff”. This puts me in the unhappy situation of keeping things in 2 places. I did this for a while, and it ended up a confusing mess.

iCloud is handy, but only on my Macs and iOS devices. It’s also never been as dependable as Dropbox. I’ve lost things. And stories like iCloud data loss with macos and ios 13 betas doesn’t help my confidence.

I use Dropbox on Linux and I once fumblefingered a command and deleted a bunch of files. These were easily restored using Dropbox. I like the way Dropbox works today.

As much as I love to try new things, I don’t feel that my file storage and sync system would benefit from the sort of tinkering that be would required to change it.

I’m bucking the trend and sticking with Dropbox.

July 6, 2019

Wrangling Hugo’s RSS templates

I just lost an hour fixing” Hugo’s handling of RSS feeds.

Hugo’s default rss template only includes each post’s .Summary, but I want to include the full .Content. There is no configuration setting for this, so in order to include full post content I have to override the entire template. This seems nuts to me, but whatever. I had already done this a while ago and it’s worked fine…until I updated Hugo to v0.55.0.

Hugo’s 0.55.0 release introduced (what I consider) a breaking change which caused the RSS feed to include all posts. The rssLimit configuration setting was replaced by a [services.rss] which relies on Config.Services.RSS.Limit. I wish someone would’ve told me. To be fair, there is something about this in the release notes but it’s not obvious and doesn’t call anything out as a breaking change, so I missed it.

I dutifully changed my settings to match, but it didn’t fix the problem. Of course it didn’t, because I’d overridden the default template and my version had no idea about Config.Services.RSS.Limit. The default RSS template is internal to Hugo but is shown in the documentation. I copied it over my own template, re-did my change to .Summary but still no luck. My RSS feed was still showing all posts. Turns out the version in the docs was wrong. Instead, I poked around the code and found the actual source for the default RSS template and copied that to ./layouts/index.rss.xml. Finally, I was again seeing full content and only the first 20 posts in the feed.

The problem then was that the feed contained entries for other non-post files that I’d edited. I only want posts in the feed, so I had to make an additional change to the template. The default is…

{ {- $pages := Data.Pages -} }

I changed mine to…

{ {- $pages := (where .Data.Pages "Type" "post") -} }

(Note I added a space between braces so they’re not rendered by the site generator)

Here’s my final version of the template.

{ {- $pages := (where .Data.Pages "Type" "post") -} }
{ {- $limit := .Site.Config.Services.RSS.Limit -} }
{ {- if ge $limit 1 -} }
{ {- $pages = $pages | first $limit -} }
{ {- end -} }
{ { printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML } }
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <title>{ { if eq  .Title  .Site.Title } }{ { .Site.Title } }{ { else } }{ { with .Title } }{ {.} } on { { end } }{ { .Site.Title } }{ { end } }</title>
    <link>{ { .Permalink } }</link>
    <description>Recent content { { if ne  .Title  .Site.Title } }{ { with .Title } }in { {.} } { { end } }{ { end } }on { { .Site.Title } }</description>
    <generator>Hugo -- gohugo.io</generator>{ { with .Site.LanguageCode } }
    <language>{ {.} }</language>{ {end} }{ { with .Site.Author.email } }
    <managingEditor>{ {.} }{ { with $.Site.Author.name } } ({ {.} }){ {end} }</managingEditor>{ {end} }{ { with .Site.Author.email } }
    <webMaster>{ {.} }{ { with $.Site.Author.name } } ({ {.} }){ {end} }</webMaster>{ {end} }{ { with .Site.Copyright } }
    <copyright>{ {.} }</copyright>{ {end} }{ { if not .Date.IsZero } }
    <lastBuildDate>{ { .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML } }</lastBuildDate>{ { end } }
    { { with .OutputFormats.Get "RSS" } }
    { { printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML } }
    { { end } }
    { {- range $pages -} }
      <title>{ { .Title } }</title>
      <link>{ { .Permalink } }</link>
      <pubDate>{ { .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML } }</pubDate>
      { { with .Site.Author.email } }<author>{ {.} }{ { with $.Site.Author.name } } ({ {.} }){ {end} }</author>{ {end} }
      <guid>{ { .Permalink } }</guid>
      <description>{ { .Content | html } }</description>
    { { end } }

And in config.toml I’ve replaced rssLimit with this…

  limit = 20

If there’s an easier way to do all this I’d love to hear about it. Maybe the addition of the new [services.rss] section suggests other pending improvements. Ideally, I wouldn’t need to override the entire RSS template in order to make these changes. And I’ll be sure to read the release notes more thoroughly next time.

July 5, 2019

See also: baty.net

I’ve resurrected baty.net, so what happens to this blog? Nothing. It’s not going anywhere, but I’m looking at other was to make use of it. Blot is great at doing stuff with images, html files, etc. Maybe I’ll make it a photo blog. Or maybe it’ll become about a specific topic.

While I think through this, you’ll probably notice more new posts at baty.net.

July 5, 2019

Things I’m doing now

A few of the things I’m doing as of Friday, July 05, 2019…

July 5, 2019

Automatic Cross-posting

Should I automatically cross-post from baty.net to all the usual places? I don’t know. Sometimes I feel like I would just be adding noise where no more noise is needed. Other times I figure what the hell, everyone else does it and people seem to love noise. Besides, it’s fun to share.

What I realized was that I often wish some of the people I follow would write more posts or show more photos or otherwise add to my feed. In the unlikely event that there are people out there who feel that way about me, I’ve once again enabled cross-posting. Apologies in advance if you’re not one of them.