seo-metadata.html uses deprecated .Page.IsNode (Hugo 0.163+)

Open Beginner friendly
#591 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
hugo
Domain
web-dev

Research direction

Open layouts/partials/seo-metadata.html and inspect the canonical-URL logic around the deprecated .IsNode check. Replace that condition with the proposed supported equivalent, then build the site with Hugo v0.166.0 and confirm the deprecation warning is gone while canonical URLs still work.

Written by the indexing model from the issue text.

Description

component/rendering

Context

While reviewing/testing PR #536 (JSON-LD structured data + canonical URLs), building the site with Hugo v0.166.0 emits:

WARN  deprecated: .Page.IsNode was deprecated in Hugo v0.163.0 and will be removed in a future release. Use .Page.IsBranch or not .Page.IsPage instead.

The warning comes from layouts/partials/seo-metadata.html, in the canonical-URL logic:

{{ if .IsNode }}
  {{ if .Paginator }}
    ...
  {{ end }}
{{ end }}

It's non-blocking today (the site still builds correctly), but Hugo has flagged it for removal in a future release, which would break the build once that happens.

Proposed change

Replace .IsNode with not .IsPage (or .IsBranch, equivalent for this case) so the partial keeps working after Hugo removes the deprecated method.

Note

This is separate from #578 (which pins the Hugo version across environments but explicitly excludes template-deprecation fixes from its scope).

Dominant language
JavaScript
Stars
25
Forks
88
Avg merge
53m
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microcks/microcks.io

All issues in microcks/microcks.io

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.