Summer Time Bug Fix

The problem The date: variable in HUGO needs to be actual, not in the past, for the post to register. I don’t know yet why but that isn’t important, only the solution is so… The correct post date format in YAML is: date: 2025-04-01T19:37:18+02:00 The last part of the string +02:00 indicates UTC1 plus 2 hours, which for my current location is CET +1 2. The first solution After a little searching, for the wrong thing (UTC offsets) I came across the Python class: time and the functiontime.daylight specifically. This boolean function returns True if it is Summer Time and False if it is Winter Time, which allows to check the state in an if statement, thus: ...

1 April 2025 · Mark

Summer Time Bug

A bit of a post winter bug My little Hugo post creation app stopped working correctly this morning. The reason was the date formatting in the post date: variable. The code had the date formatted for GMT + 1 and now we have GMT + 2. I haven’t checked what was happening, but assume the date must be in the future for it to fail to post. I can’t see it as a date in the past, which seems more logical given +1 instead of +2. ...

30 March 2025 · Mark

I Have An Icon

How I did it I recently wrote a Python app for creating a basic HUGO post, front matter and post.md file in content directory. Then I decided to make an icon on the desktop to launch the code. This is what I did: These instructions are for MacOS not Windows: The main thing is to create a shell script that runs the python file and then copy it to the desktop and remove any extension like .sh ...

17 March 2025 · Mark

Purge git repo history

I mentioned in a previous post that I had used git and git hooks to upload Hugo blog posts to my server, and that I am now using rsync as a faster more succinct alternative. This has left me with lot of git history in my .git folder, which I really don’t need. I don’t think I am ever going to want to recover a blog post version, ever. So I thought why not just delete all the history and reduce the junk in the site directories. ...

28 March 2023 · Mark

Hugo Google-News Error

The Hugo theme template partial google-news has been deprecated for quite some time. A warning message has been posted on build for just that very reason. After the last update of Hugo v0.111.2+extended the partial appears causes Hugo to fail while building. This is the error thrown on my Mac: ❯ hugo Start building sites … hugo v0.111.2+extended darwin/arm64 BuildDate=unknown ERROR 2023/03/07 23:21:02 render of "page" failed: "/Users/mark/websites/markbtomlinson.com/themes/PaperMod/layouts/_default/baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:162:18: no such template "_internal/google_news.html" I had been expecting an error, or problem, eventually and as is normal, it happened late at night. It took me a little file search in VSC to find the file in the Hugo theme directory and delete the line causing the issue. ...

8 March 2023 · Mark

Git Hooks to Rsync

Getting un-hooked You Git I have been using Git Hooks to sync local Hugo website files to my remote server. This has worked well, mostly, but I wondered if it was the most efficient way of syncing up. I use Git on the local web structure and so have version control. Using Hooks allows me to upload to a remote location and then have the remote server copy the modified file into the live site directory,. This involves a few steps and some repetition and isn’t completely error free. If the Hooks location gets out of sync, which it did for me a couple of times I had no alternative, at least one that worked, but to recreate the Hook directory and start again. ...

1 March 2023 · Mark

Typora Symbolic Links Mac

Unfortunately Symbolic Links and shortcuts don’t work within Typora’s file listing. I found a work around though: Create a symbolic link to the folder you wish to add in the default Typora markdown directory, this will then show up in the the file listing, it won’t do anything though if you click on it, as it isn’t implemented or supported in Typora yet. But, if you right click on the icon link in the file list and choose Open in New Window it will load the linked directories contents. ...

1 October 2022 · Mark

FrontMatter for VSC

I recently set up a addon for Visual Studio Code, for editing Markdown files in HUGO. The addon was from Elio Struyf called FrontMatter. I got it working quickly enough. Although I had problems with the media paths not showing correctly in the media browser. The reason for this was, I’d used the default setting (as mentioned in the documentation) which assumes media will be in the root static folder, where as I had media in an assets folder under the content folder. ...

1 November 2021 · Mark

Git Version Control Setup

After a few false starts I have finally got my Hugo site setup to use git submodule to push the HTML output to the remote webserver. It was a little involved at first, but once I got my head around the idea of a git repo within a git repo, not being a git repo but rather just a folder marked as a submodule of some parent module… you get the idea. A confusing concept that is simple and sounds simple, but isn’t explained particularly well in any article I found. ...

25 October 2021 · Mark