Shortcode fun

I’ve been using Hugo for this blog for a few years now. It works well for me and I’ve not done much customization to the theme at all. Earlier this year, I took at look Mermaid to produce some charts for inclusion in the blog. The way that worked was by using a link to content hosted on another site. That was really easy to do, but I’d rather have the content inside my blog content.

Read More

Bit Rot

I noticed the other day that the search function on this blog had somehow been broken. I’m not sure how as I’ve not changed anything recently in the layout or functionality. In any event, it wasn’t working and I wanted to fix it. After a quick look at the harbor theme README.md indicated that I needed to have a search.md file in the content directory. I didn’t have it so I created the very simple file and added it.

Read More

Alias for post creation

Hugo has worked out well for creating this blog. To make it even easier, I wanted to make creation of new posts simpler. To date, I’ve basically looked at the last post and then created the next one in sequence by using the command hugo new ~/myblog/post/content/091.md, for example. To automate that some, I created a bash alias that looks like: alias newpost='hugo new ~/myblog/content/post/$(printf "%03d.md" $(expr $(basename $(ls ~/myblog/content/post/ | tail -n 1) .

Read More

Blog restructure

I felt the need to renumber my blog posts file names from a date (e.g., 20211222.md) to a sequence (e.g., 087.md). Hugo does a nice job of putting posts from the same date into a folder labeled for that date, so the date numbering was restrictive if I wanted to create two posts on one day (admittedly, a rarity). A number also is a nice way for me to keep track of how many posts I’ve written since I started doing this again.

Read More

Hugo on Mac

I’ve been using Hugo for a little while now on Linux. Since I had my MacBook with me this weekend, I wanted to give it a try. It was easy. The first thing to do was to do a git clone for my blog content. Nothing surprising there. Next, I installed Hugo using brew install hugo. That took a few minutes but got me v0.76.5/extended on the Mac. No issues.

Read More

Updates to harbor theme

As I posted before, I switched my theme over to harbor which I quite like. However, I wanted to make some changes to the look and feel of the page. There is a way of overriding the CSS in a Hugo theme but it wasn’t part of harbor. So, I created an issue on github to see if had just missed the feature. Much to my delight, the author of the theme picked it up and did a change to the theme this weekend so I could do a simple override and change up a few font colors.

Read More

Fixed a few things

I listed three things to fix after my theme migration. I added some reasonable text to the about page and found the source of the weird cruft on the last page of posts. It turns out that somehow I had corrupted the text of one of my old posts and substituted the contents of a PNG file. I’m not sure how that happened but the fix was easy: delete it.

Read More

git submodules

As part of my switch to a new theme, I followed the instructions in the harbor theme to add the theme: $ # install $ mkdir themes $ cd themes $ git submodule add https://github.com/matsuyoshi30/harbor.git harbor That worked and everything was rendering fine using hugo serve on my main system. Sometimes, I use a different system to write posts and I wanted to get the updated code on there. After merging my pull request in github, I ran git pull to get the site updated on my laptop and created a new post.

Read More

Changing my Hugo Theme

I wanted to change my site theme from Ghostwriter to Harbor. I like the look better and Harbor has a nice search feature which seems useful. I had hoped that this would be simple, but Hugo Themes don’t follow a strict standard for where things go and how they are configured. Instead, I had to move my post files around (restructuring my naming convention at the same time) and redo the config.

Read More

Scheduling builds on Netlify

I like the publication workflow in Netlify with Hugo. It’s pretty easy: everything in your master branch is published when it’s committed. That’s quite nice. But if you want to create entries that get published in the future, it’s not as convienient. A quick search on the Netlify Community had a few options listed. But none seemed easier than this one which proposes using a scheduled Github Action to push the build to a Netlify build hook.

Read More