8000 hugo build: warning '.File.UniqueID on zero object' · Issue #1007 · google/docsy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
hugo build: warning '.File.UniqueID on zero object' #1007
Closed
@deining

Description

@deining

How to reproduce

  • Create a new site from scratch as described here.
  • Create a new page inside the docs folder: hugo new content/docs/_index.md
  • Run hugo -D and you will get this warning:
hugo v0.98.0-165d299cde259c8b801abadc6d3405a229e449f6+extended windows/amd64 BuildDate=2022-04-28T10:23:30Z VendorInfo=gohugoio
WARNING: calling IsSet with unsupported type "invalid" (<nil>) will always return false.
WARN 2022/05/09 09:57:25 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}

Using hugo --panicOnWarning, you can track down where the error originates:

Error: Error building site: failed to render pages: render of "section" failed:
execute of template failed: template: docs/list.html:12:11:
executing "main" at <partial "section-index.html" .>
: error calling partial: "...\layouts\partials\section-index.html:7:17":
execute of template failed: template: partials/section-index.html:7:17
: executing "partials/section-index.html"
at <where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID>:
error calling where:
Warning trapped. Remove the --panicOnWarning flag to continue.

So the offending code line is here:

{{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0