Hugo Workflow, Archetypes, and Other Things of Note
TechnologyWelcome to the first ever Week in Review from ReplTo! My hope is to make this a regular thing. I often get to the end of a week and look back wondering where the heck all my time went.
Doing a review is really handy. When I reflect on my activities for the week I realize I really didn’t just wander aimlessly through the past seven days. Even better I get new ideas to explore and share with you.
Once again welcome and let’s begin reflecting on another week gone by at ReplTo.
Blog Posts this Week
I did write a python article didn’t I? Not sure. Yes, turns out I wrote two! Hopefully, the titles are self-explanatory.
Blogging vs Writing Articles
Probably, the biggest change I made this week was getting my head clear about what kind of writing I am doing. By that I mean, am I writing essays and articles? Or am I writing more informally, keeping a log or journal, of my tech research and tinkering?
For whatever psychological reason when I call what I write an article all the sudden I have a whole bunch of high expectations which just get in the way. When I write blog posts then the expectations ease up.
Being more informal fits me much better.
This switch in perspective meant I needed to go back and revert a bunch of changes I made to my Hugo set up. They weren’t difficult just took a little time and testing.
Changes to Hugo Archetypes
I made changes to the archetypes, which are the templates used to create a new blog post. While I was changing what to call the archetype I also changed the template itself.
Related to the front matter changes. Dates on blog post file names were deleted. I was using the date to help sort the files but had to edit the date out of the file name. Not only was it adding to my blog post work load I was setting myself up for url collisions in the future.
I have the title for each post generated from the filename. Pre-pending the date to the filename made every filename unique. If I create a future post with the same title as a past post, with the date making them unique, in the end I could have two posts with the same url.
As a bonus to getting things cleaned with filenames I got to learn a new Emacs key combo. Using the key combination below and the navigation keys I set the selection area then deleted all the pre-pended dates in a couple key strokes. All from the directory browser.
Emacs Trick!
C-x C-space
This is going to be so handy. Of course, like many things I learn about Emacs it has been around a very long time. Better late than never!
With the above key combo you can set the beginning of an area to edit. This differs from the typical mark by only showing the columns of text between the set point and current position of the cursor. What gets highlighted is the actual text being selected. With the typical way of selecting text the entire row gets highlighted. Which I have found confusing.
YAML Front matter
Editing the YAML front matter parameters for each of the blog archetypes also simplified processing and workflow. Less editing while writing a post is a big plus. With changes I made to the filenames (see above) I didn’t need a url: parameter.
....
author: Eric
....
tags: untagged
Hugo Layouts
Layouts have been simplified. Every section (sub-directory under “content/”) uses the default layout. Except Pages. Pages is where the About and various Terms type pages are kept.
What is different about Pages? No social icons and tag cloud at the bottom of the post.
Posts in sections besides blog (and Pages) just need to have their type set to blog and to get rendered with social icons and tags. There aren’t any other section but nice to be prepared! On my site Occult Alchemy I do have multiple blog post sections. This solution lets me use the same layout for each site. Yay!
SEO Modifications
While I was doing surgery on my set up I took a look at some ways to help with SEO. One thing I did was take a look at my custom_header partial. I added the following line for a mobile friendliness.
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
A site I quite like, https://xeiaso.net/, inspired me to make some visual changes. A bit retro. I particularly liked the background color and the front page content and layout.
After changing the background color contrast between background and text, both links and content, wasn’t very good. While not a big SEO factor, from what I read, it can be a thing. Luckily there are web sites out there to help you find color settings for good SEO friendly contrast and readability. Search for “CSS contrast color generator” or similar.
Descriptions for all the posts on all my sites needed work. I deleted what descriptions were there and added new ones to all my posts on ReplTo. Occult Alchemy will have to wait. Too many posts to get to right now.
Social Media
Last but not least I plunged deeper into social media. After having deleted all my social media accounts, except Instagram, during the Covid/Election Season drama-fest, I only went back to Twitter recently.
This week though I signed up for Facebook and LinkedIn. Again.
We’ll see how everything pans out. There are a few people I want to stay in touch with including close family. Also, some organizations and events I am interested in are only on Facebook. Hopefully, I can keep my connections limited on Facebook. Hard to be a hermit these days.
I do have Facebook pages for this site and Occult Alchemy which is nice. Interestingly, when I tried to get a url for my old occult site it was taken. Plunking around for ideas I came up with the name OccultAlchemy. Liked it so much I paid for the domain name for the site, too. Lucky it was available!
Okay, that pretty much sums up the week. The tech side anyway. Thanks for reading and have a great next week!
Share with Friends!