Site no longer builds (locally or on GitHub) after upgrade from 145 to 147... (brew)

Hi there,

I just ran brew upgrade hugo, and now have version 147. Unfortunately, my site does not build any longer, with the error:

er.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: maximum template call stack size exceeded in "/Users/jcw/Documents/web/jchwenger.github.io/layouts/partials/header.html"

(Repo here.)

I just tried reverting to 145, but brew does not seem to accept that either… Any idea how to solve this? It worked perfectly fine earlier…

Thanks in advance!

Aaah, just seeing this update, will see if I get this to work.

Ok, I solved it (but also an interesting piece of behaviour in the process).

So, the directory is reconfigured like so:

.
├── 404.html
├── _markup
│   ├── render-heading.html
│   └── render-link.html
├── _partials
│   ├── content.header.html
│   ├── footer.html
│   ├── header.html
│   ├── header.includes.html
│   ├── i18nlist.html
│   ├── letterhead.html
│   └── nav.html
├── _shortcodes
│   ├── gallery.html
│   ├── html.html
│   ├── poetry.html
│   ├── separators.html
│   └── youtube-playlist.html
├── baseof.html
├── index.html
├── list.html
├── single.html
└── terms.html

I still get the error:

error calling partial: "/Users/jcw/Documents/web/jchwenger.github.io/layouts/_partials/header.html:17:5": execute of template failed: template: _partials/header.html:17:5: executing "_partials/header.html" at <partial "header.includes.html" .>: error calling partial: maximum template call stack size exceeded in "/Users/jcw/Documents/web/jchwenger.github.io/layouts/_partials/header.html

header.html called header.includes.html like so:

{{ partial "header.includes.html" . }}

And that caused the recursion, probably because somehow header.includes.html is truncated to header? Changing the name to header-includes.html, or another name, resolves it.

So using this dot syntax for these files names isn’t recommended : >.

except if you want fallbacks for lang, output format…

see this topic for the . problem in partial names:

I’m not sure what you mean by this. The documented identifiers in the template filename are:

The identifiers that can be used in a template filename are one of the Page kinds (home , page , section , taxonomy , or term ), one of the standard layouts (list , single , or all ), a custom layout (as defined in the layout front matter field), a language (e.g., en ), an output format (e.g., html , rss ), and a suffix representing the media type. E.g., all.en.html and home.rss.xml .

So…

  1. The page type is not one of the identifiers
  2. When you include things like output format identifier, you are increasing the specificity, not creating a fallback.

you are right

  1. was a malicious edit should have been lang :shame:
  2. mmh, point of view.

or a language barrier

Yeah, that one.

most specific -------> less specific -------> least specific
              fallback               fallback

Sounds hugood!

My header.html was looking up header.includes.html, and since no includes.html had been defined in layouts (and it’s not a default type, lang, etc.), it trimmed it to header.html, which was found, then did that all over again, in a charming infinite recursion loop!

TIL about these naming conventions for partials, pretty cool, thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.