Open scotte opened 6 months ago
Thanks! It also worked.
Specifically, you can change this:
<title>
{{- $paginator := .Paginate .RegularPagesRecursive }}
{{- with .Params.seo_title -}}
{{- . -}}
{{- else -}}
{{- .Title -}}
{{- end -}}
{{- with $paginator -}}
{{ if and (gt $paginator.TotalPages 1) (gt $paginator.PageNumber 1) }}
| Page {{ $paginator.PageNumber }}
{{- end -}}
{{- end -}}
{{ if (or (and (ne .Type "posts") (ne .Type "projects") (not .IsHome)) (and (not .IsPage) (not .IsHome))) }} | {{ .Site.Title -}}{{ end -}}
</title>
into this:
<title>
{{- if and .Page.IsNode .Page.Paginator -}}
{{- $paginator := .Paginate .RegularPagesRecursive }}
{{- with $paginator -}}
{{ if and (gt $paginator.TotalPages 1) (gt $paginator.PageNumber 1) }}
| Page {{ $paginator.PageNumber }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- with .Params.seo_title -}}
{{- . -}}
{{- else -}}
{{- .Title -}}
{{- end -}}
{{ if (or (and (ne .Type "posts") (ne .Type "projects") (not .IsHome)) (and (not .IsPage) (not .IsHome))) }} | {{ .Site.Title -}}{{ end -}}
</title>
For other looking to make this work, you can override this directly without vendoring the entire theme. To do that just create the folders/directories layouts/partials/head/seo/
and drop the above code into seo.html
Describe the bug With hugo v0.123, this theme results in
execute of template failed: template: partials/head/seo/seo.html:17:20: executing "partials/head/seo/seo.html" at <.Paginate>: error calling Paginate: pagination not supported for this page: kind: "page"
I don't know if it's the right solution, but I wrapped the code block here https://github.com/wjh18/hugo-liftoff/blob/master/layouts/partials/head/seo/seo.html#L17 with
{{- if and .Page.IsNode .Page.Paginator -}}
as recommended here https://github.com/gohugoio/hugo/issues/12080I know this theme is no longer maintained, creating this for the next person who runs into this issue.