Closed alexishuf closed 4 months ago
I am encountering the same issue.. :(
Also encountering this issue. Found a nice blog post about it at https://www.irisclasson.com/2024/02/21/hugo-error-calling-paginator/.
For now I made the following change to override the layout.
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html
index 691f114..cb9c888 100644
--- a/layouts/partials/head/meta.html
+++ b/layouts/partials/head/meta.html
@@ -92,18 +92,6 @@
<!-- Article Specific Tags -->
<!-- To make sure this renders only in the article page, we check the section -->
{{ if eq .Section "posts" }}
-<!-- Pagination meta tags for list pages only -->
-{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
-{{ if $paginator }}
- <link rel="first" href="{{ $paginator.First.URL }}" />
- <link rel="last" href="{{ $paginator.Last.URL }}" />
- {{ if $paginator.HasPrev }}
- <link rel="prev" href="{{ $paginator.Prev.URL }}" />
- {{end }}
- {{ if $paginator.HasNext }}
- <link rel="next" href="{{ $paginator.Next.URL }}" />
- {{end }}
-{{end }}
<meta property="og:type" content="article" />
<meta property="article:publisher" content="{{ .Site.Params.facebook_url }}" />
I have no clue neither if this bug is really from hugo
or poison
, given https://github.com/gohugoio/hugo/issues/11949 and https://github.com/gohugoio/hugo/issues/12080 I'd say poison
though, hugo maintainers seem to stick with their changes.
Anyway I cloned hugo
's repo and using git bisect
managed to identify the commit introducing (or triggering) this behavior:
https://github.com/gohugoio/hugo/commit/6c3b6ba3e6ccc220cbca9cc83fab78db0a78604e
I'm not used to hugo's code so I don't know if I'll do something of it but here it is if someone needs it
also https://github.com/AmazingRise/hugo-theme-diary/issues/177#issuecomment-1962833666 seems to be a fix, don't really know if this applies well to poison though
also AmazingRise/hugo-theme-diary#177 (comment) seems to be a fix, don't really know if this applies well to poison though
I applied this fix and it compiles successfully.
Replace line 94 in layouts/partials/head/meta.html:
{{ if eq .Section "posts" }}
with:
{{ if and (eq .Section "posts") (.Page.IsNode) }}
@FLopriore it seems to fix it, could you propose a PR to the repo?
@FLopriore it seems to fix it, could you propose a PR to the repo?
Yes, I do it right now
Thanks, everyone! Sorry for being MIA the past several weeks. PR is merged. :+1:
Thank you! Updated my website to the latest version and it's working well.
Poison site does not build with hugo 0.123.0 and 0.123.1, but builds with v0.122.0
Steps to reproduce:
Outputs:
The relevant code in
layouts/partials/head/meta.html
:Deleting this code gets the build to complete.
gohugoio/hugo#11954, merged into hugo 0.123.0 might be related. My understanding of hugo is limited and as there was no issue reported on the hugo repo yet, it could be a poison issue.