Things I Have Written

Link Posts in Hugo

Most popular blogging platforms or themes made for them support some kind of link post format as an alternative to a regular, “this is my own original content” post. The idea is that you can link to something somewhere else on the web, and add your comments in your own post. Typically the link post title links to another site, and there is a permalink URL to your own post.

I don’t plan to write a lot of link posts, that’s not the point of my site, but I knew it would be nice to do so whenever I like without having to step outside my blog post shortcuts and blog post template archetypes and manually edit things. To support this, I added the ability in all my section and home list and single article pages to check for a front matter variable called “linkurl”.

Here’s what …

(Read More)

Hugo Shortcode For Custom Image Handling

On my generously sized list of improvements I need to make to this site are a couple of image handling items. I crossed off one of those today, after going down a Rabbit Hole while writing another post that I intended to publish today instead of this one.

Up until now, when I’ve put a screenshot image in a post on this site, I’ve just linked to it directly, which causes a couple issues. First, there’s the image sizing issue – screenshots are high resolution and so appear massive when just linked to inline like that. Second, alignment preferences and captioning can be an issue.

Hugo does have a figure shortcode, but as far as I can tell, it doesn’t have any way to set the image alignment. It does support setting a css class for the figure, but I couldn’t find a way using css to actually affect my image alignment when using the Hugo figure shortcode.

So I wrote …

(Read More)

 MacStories Shortcuts Icons

This might fall into the frivolous category for a lot of people, but I make a lot of home screen icons for shortcuts I use frequently, so I enjoy the MacStories Shortcuts Icons tremendously.

I’ll even admit to going a little nutty and replacing several of my app icons on my iPhone home screen with them, using them as app launchers rather than icons for shortcuts, but that’s another story. I wouldn’t recommend that for most people, as it makes opening an app into a bounce-through-shortcuts experience.

Still, it’s fun to experiment with alternate looks that Apple won’t give us.

But if you create lots of shortcuts and put icon shortcuts to your actual shortcuts (whew!) on your home screen, these will help give personality to them as well as make them easily and quickly identifiable for you.

 Permalink

Shortcuts for Blog Posting – Taxonomies

As someone who does a lot of work on the iPad, I have always wanted to be able to create efficient workflows for posting things to my various sites. This being a site that I own, it’s no exception.

One downside to moving the site from Wordpress to Hugo is that posting is basically a matter of putting the article content into a specific part of a markdown template, putting category and tag information into their designated part of the template, moving the edited file to the desired location for the post to appear, and recompiling the site with the “hugo” command.

I already knew I was going to make a shortcut to handle posting to the site for me, for the sake of ease and consistency. The beauty of automation is you never fat-finger a template edit and wind up having to fix something later when you notice. Also, …

(Read More)

Working Copy WebDAV Server

I’m an avid user of Working Copy, the brilliant iOS Git client from Anders Borum. Apparently I still have a few things to learn about it though, as I discovered while listening to Episode 71 of the excellent iPad Pros podcast.

It turns out that in order to solve the problem of being able to browse and work with Working Copy repos from directly within Panic Code Editor (another iOS app that I use every day), Anders bestowed upon Working Copy a built-in WebDAV server. Fire it up, create a server entry in Code Editor pointing to the WebDAV server IP, and get to work.

The best case scenario is that when Panic updates the app, they allow direct access through Files app integration, since Working Copy can act as a Files location provider, but in the meantime, this solution works pretty well.

Using Hugo content sections for RSS feed flexibility

I’ve done a lot of testing with Hugo’s RSS feed generation in the past week, and one fact stands out: you can fight the law, but the law always wins.

In Hugo’s case, the law is content sections. Content sections are the key to RSS flexibility.

You may remember me expressing some bitterness about the way Hugo’s default is to litter the place about with RSS feeds for every single type of taxonomy that you have enabled. Having an RSS feed for every tag is silly, and so I figured I would just disable that. Turns out, it’s not so simple.

As I discovered last week, there’s a lack of granularity for enabling and disabling RSS feeds beyond sections, taxonomies, and taxonomy terms. That sounds great, until you realize I’m not talking about specific sections, taxonomies, and taxonomy terms. I mean all sections, or all taxonomies, or all taxonomy terms. Hugo RSS …

(Read More)

Hugo Feed Link

Yesterday I wrote about how to customize your Hugo RSS feed so that you have one feed named feed.xml. One other addition you may wish to make is to link to it in your page headers.

It’s simple enough – assuming you’ve made the modifications to make Hugo name your RSS feed “feed.xml”, add the following to your base template somewhere between the <head></head> tags. Obviously there will be a lot more in your page header, but this is simplified for our purposes.

<head>
    
<link rel="alternate" type="application/rss+xml" href='{{ "feed.xml" | absURL }}' />
    
</head>

Now when you view your page source, you’ll see a link to your RSS feed embedded within.

Hugo page header RSS link

By the way, in case you’re wondering how I did a view source on iPadOS, the answer is a View Source shortcut, which can be found here.

Customizing Hugo RSS Feeds

Yesterday I griped about the way Hugo generates RSS feeds for every section and taxonomy, and how it names them all index.xml. Then, not long after I posted my complaints, I found all the answers I’d been seeking.

First, the default RSS handling in Hugo is weird. Anyone who thinks it’s how RSS should work on a website is … well, let’s just use the word wrong and smile in a friendly manner while we do. But it’s wrong.

The good news is, both of my desired changes, having one RSS feed for my blog posts only and having that feed named feed.xml, are quite simple to achieve. All that’s needed are some minor additions to the site config file and an RSS template.

The list of steps to perform are as follows:

  • Configure the site to have one single RSS feed in the site’s root directory.
  • Configure …

(Read More)

Hugo RSS Feeds

One thing about Hugo that I’m not in love with so far is its default RSS feed handling, which admittedly I most likely don’t fully understand. What I want from my site is specific feeds for specific things, and nothing more. That might sound controlling, but it’s not about that so much as it’s about clarity and organization.

For example, Hugo by default makes an RSS feed for all new content on the site. That means if I create a Contact page or an About page or a Projects page, it gets added into my RSS feed, which seems really stupid it me. Generally people want RSS to follow blog posts or specific topics. That’s what I want too.

In addition to this overall, way too comprehensive feed, Hugo loves to create feeds for every item in every taxonomy type. I don’t want to be rude to whoever decided this was a great idea, but does it really seem likely that anyone wants to follow an RSS feed for tags used in blog posts? …

(Read More)