I have a really, really annoying problem and I don’t know if it’s text editor or hugo. I wrote this line:
{{ .Getpage “docs”}}
There are two leading spaces after the ̀{{`.
Like this I get:
Error: “/home/drm/WEBSITE/layouts/partials/docs/menu.html:25:1”: parse failed: template: partials/docs/menu.html:25: unrecognized character in action: U+00A0
And when I edit out the first leading character, I get:
Error: “/home/drm/WEBSITE/layouts/partials/docs/menu.html:25:1”: parse failed: template: partials/docs/menu.html:25: unrecognized character in action: U+FFFD ‘�’
Then I undo the change, and the first message doesn’t come back. Of course, neither unicode characters are present at the start of the line. I tried editing it in nano too, same issue, so it might not be micro after all. Is the parser bugging ?
Version: hugo v0.123.7-312735366b20d64bd61bff8627f593749f86c964+extended linux/amd64 BuildDate=2024-03-01T16:16:06Z VendorInfo=gohugoio
Same happens with 0.122.0
artifact. I’m not seeing any “ or ” if that’s what you mean. Or am I mistaken ? I certainly wouldn’t introduce them willfully.
Ok, I replaced my context declaration by yours, which I prefer anyway. But it seems its main merit (because mine worked for @jmooring) was to make the error message clearer:
Error: error building site: render: failed to render pages: render of "page" failed: "/home/drm/WEBSITE/layouts/_default/baseof.html:10:40": execute of template failed: template:
_default/single.html:10:40: executing "menu-block" at <partial "docs/menu" .>: error calling partial:
"/home/drm/WEBSITE/layouts/partials/docs/menu.html:49:23": execute of template failed: template:
partials/docs/menu.html:49:23: executing "menu-filetree" at <where .Site.RegularPages "Section" "docs">:
error calling where: can't iterate over <nil>
So even though the pages within the sections are published all right… the sections aren’t counted among .Site.RegularPages "Section" "docs"