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
Comments are turned off on this site, if you wish to say something you are invited to do so via Mastodon