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 · 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 · 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 · 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
Shader ball in a stage lighting scene

Stage Lighting

A brief recap of the week thus far: I have been busy experimenting with Blender again, this time on cosmetics and such as way to try out some different rendering environments. Normally I use a basic three point lighting set up with an HDR image as the fill light. Usually something fairly flat like a cloudy sky to give a balanced background light. ...

8 March 2025 · 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 · Mark

Just A Pot

This month has been an unadulterated mess, geopolitically, but I am not here to post about that, politics are one thing I try to keep off line there is more than enough Troll fodder out there already. It has however been very nerving and frankly bewildering. So much of a distraction in fact I ended the month with little more than a pot, that’s it a pot. Perhaps because the whole month has been so damned potty. ...

24 February 2025 · Mark

Small Computer Parts

I had some fun recently modelling some diverse computer components. It started when I spotted a Ryzen CPU online and thought it would be interesting to recreate it in 3D. Initially I created an SVG plan of the chip from which to model. After the CPU I decided to have a go at a little Solid State Drive. I have this on in my machine so that seemed apt. ...

29 January 2025 · Mark

First Post of the Year

I started the new year playing with some image textures for my models, in particular metal and rust: Example maps used above As an example of some of the textures I made here is a Steel and Rust one used on the shader ball I made. If you wish you can right-click and download them and use them on your own work as you please: ...

5 January 2025 · Mark