Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with hugo v0.123 #41

Open
scotte opened this issue Mar 10, 2024 · 2 comments
Open

Not compatible with hugo v0.123 #41

scotte opened this issue Mar 10, 2024 · 2 comments

Comments

@scotte
Copy link

scotte commented Mar 10, 2024

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 gohugoio/hugo#12080

I know this theme is no longer maintained, creating this for the next person who runs into this issue.

@ZhenHuangLab
Copy link

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>

@grimmy
Copy link

grimmy commented May 16, 2024

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

grimmy added a commit to HackAndTellRocks/www.hackandtell.rocks that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants