Skip to content

Missing template definitions breaks production builds in Hugo v0.146.0+ #1719

@arikpoz

Description

@arikpoz

What you'd like to propose?

Hi!

In the latest version of PaperMod, the following templates are referenced inside _partials/head.html:

{{ template "partials/templates/opengraph.html" . }}
{{ template "partials/templates/twitter_cards.html" . }}
{{ template "partials/templates/schema_json.html" . }}

However, these templates are not defined in the theme (using {{ define ... }}), which causes the Hugo build to fail in production mode:

Error: html/template:_partials/head.html:155:13: no such template "partials/templates/twitter_cards.html"

This is especially confusing because it only triggers in production (i.e., hugo.IsProduction == true), so users upgrading from an older version may not notice the issue until CI breaks.

Suggested Fix:

  • Provide empty stub templates for these in layouts/partials/templates/, e.g.:
{{ define "partials/templates/twitter_cards.html" }}{{ end }}

That way, users can override them if needed, but the build won’t fail by default.

Thanks for the great theme!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions