Skip to content

Build fails on Hugo 0.156+ — site.Author removed from site object #35

@Storagezilla

Description

@Storagezilla

Hi Jim,
Just a heads up. I saw Manton suggest using Hugo 0.158 due to it's improved speed but that throws a build error with mnml.

Hugo version: 0.158 (via Micro.blog)
mnml version: 2.8.4
Previous working Hugo version: 0.91

Description
Hugo v0.124.0 deprecated .Site.Author and v0.156.0 removed it entirely. Micro.blog recently added Hugo 0.158, which causes mnml to throw the following error:

ERROR error building site: render: failed to render pages: render of
"layouts/_default/baseof.html:7:11": execute of template failed:
template: post/single.html:7:11: executing "post/single.html" at
<partial "footer.html" .>: error calling partial:
"layouts/partials/footer.html:6:106": execute of template failed:
template: _partials/footer.html:6:106: executing
"_partials/footer.html" at <site>: can't evaluate field Author in
type interface {}

The error points to layouts/partials/footer.html line 6, which references site.Author (or .Site.Author).

Suggested fix
Replace references to site.Author / .Site.Author with .Site.Params.author and move any top-level [author] config entries under [params]. This is the same fix applied by other Hugo themes (e.g. Congo #1149, Docsy #1899).
Hugo's own deprecation notice recommends using .Site.Params.Author or implementing an author taxonomy.

Thank you for your wonderful theme!

Regards,
Mark.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions