Hugo Update Problem

Hugo Post after update fails After updating to HUGO version v0.146.0 I was unable to run the compilation due to template definition errors. I found the solution below and after correcting the lines shown in the diff all was working once again. For those unfamiliar with diff the lines starting with a +green are the new line, the -red the old. diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 3e55c67..ae6450a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -150,8 +150,8 @@ {{- /* Misc */}} {{- if hugo.IsProduction | or (eq site.Params.env "production") }} -{{- template "_internal/google_analytics.html" . }} -{{- template "partials/templates/opengraph.html" . }} -{{- template "partials/templates/twitter_cards.html" . }} -{{- template "partials/templates/schema_json.html" . }} +{{- partial "google_analytics.html" . }} +{{- partial "templates/opengraph.html" . }} +{{- partial "templates/twitter_cards.html" . }} +{{- partial "templates/schema_json.html" . }} {{- end -}} diff --git a/layouts/partials/templates/schema_json.html b/layouts/partials/templates/schema_json.html index dc3bfd6..8a4efb4 100644 --- a/layouts/partials/templates/schema_json.html +++ b/layouts/partials/templates/schema_json.html @@ -85,7 +85,7 @@ {{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}, {{- end}} {{- else }} - {{- $images := partial "partials/templates/_funcs/get-page-images" . -}} + {{- $images := partial "templates/_funcs/get-page-images" . -}} {{- with index $images 0 -}} "image": {{ .Permalink }}, {{- end }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 6b0d59b..a6e1d05 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -6,7 +6,7 @@ <meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}"> {{- end}} {{- else }} -{{- $images := partial "partials/templates/_funcs/get-page-images" . -}} +{{- $images := partial "templates/_funcs/get-page-images" . -}} {{- with index $images 0 -}} <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:image" content="{{ .Permalink }}"> Link to the Original Post ...

2 May 2025 · 2 min · Mark

May Day

May Day It is the first of May or in the common parlance: May Day. The international workers day and a public holiday in most western countries. I took the day as a day of rest and relaxation, enjoying the fine weather and relative peace and quiet for a change. The older I get, the more noisy humans irritate me and my ability to ignore them diminishes. Perhaps I am imagining it but I am sure world is just getting louder and more annoying. ...

1 May 2025 · 1 min · Mark

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 · 2 min · 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 · 1 min · 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 · 1 min · Mark

Zoom Image on Click in HUGO

Edit the extend_footer.html ,location shown above, and add the following snippet to the file. This will then zoom the image when clicked and set the background to a darker grey. {{- /* Footer custom content area start */ -}} {{- /* Insert any custom code web-analytics, resources, etc. here */ -}} <script src="https://cdnjs.cloudflare.com/ajax/libs/medium-zoom/1.0.6/medium-zoom.min.js" integrity="sha512-N9IJRoc3LaP3NDoiGkcPa4gG94kapGpaA5Zq9/Dr04uf5TbLFU5q0o8AbRhLKUUlp8QFS2u7S+Yti0U7QtuZvQ==" crossorigin="anonymous" referrerpolicy="no-referrer" ></script> <script> const images = Array.from(document.querySelectorAll(".post-content img")); images.forEach((img) => { mediumZoom(img, { margin: 0 /* The space outside the zoomed image */, scrollOffset: 40 /* The number of pixels to scroll to close the zoom */, container: null /* The viewport to render the zoom in */, template: null /* The template element to display on zoom */, /*background: "rgba(50, 50, 50, 1)",*/ }); }); </script> {{- /* Footer custom content area end */ -}}

26 February 2025 · 1 min · Mark

Nearly missed November

I haven’t posted at all this month, I have been busy though so to make it before December here is a little model I made at the end of last month: I don’t think next month will be any better, we will see…

30 November 2024 · 1 min · Mark

Fix Windows Desktop Icon Spacing

I recently screwed up my Desktop Icons in Windows 11. I had been playing with the scaling factor and that had messed up the icon space scaling. The icons ended up with a massive hit size as shown above. To reset the icon sizes all you need to do is edit the WindowMetrics in the Windows Registry. Using the Registry Editor search for IconSpacing or follow the path in the image bellow. The default seems to be -1125 and if you see a massive negative number then that is the problem. ...

23 July 2024 · 1 min · Mark

Cut and paste in Finder

Mac doesn’t support Cut and Paste from Finder using: CMD-X CMD-V But you can achieve exactly the same results by using: CMD-C and then CMD-OPT-V This isn’t very intuitive as most OS’s use Ctrl-X and Ctrl-V, but the functionality is there if a little hidden. For a bonus tip: if you hold press ALT/OPTION over the open Menu Bar you will see alternative functions appear. There is at least one plugin on the App Store, that turns this into CMD-X, but to be honest, I don’t think CMD-OPTION-V too hard a combination to master. ...

18 June 2023 · 1 min · 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 · 2 min · Mark