Error: add site dependencies: load resources: loading templates: failed to parse “_default/list.json”:: template: _default/baseof.json:18: unexpected in command
I can pretty sure that I’ve declare the block “footer” and define it to use the compile keeps throwing that error. Why is that?
ju52
October 1, 2019, 1:07pm
2
You should not use DEFINE multiple times in one file.
the define main should be the outer edge, move the two other "define"s inside main and change it to
{{ define main }}
{{ partial header . }}
content
{{ partial footer . }}
{{end}}
define
is a way for us to fill the the block
(placeholder) with a custom code. So we can use as many define
as block
declared in baseof.html
. I don’t believe that is the cause of the error.
Btw, your sample code has a wrong syntax: {{ define main }}
-> {{ define "main" }}
ju52
October 1, 2019, 5:59pm
4
I couldn’t find anything about it in the docs. In all examples I have seen only one DEFINE per file.
maiki
October 1, 2019, 7:09pm
5
starlight-tu:
Why is that?
Eyeballing: are you missing an end
on your paginator statement?
1 Like
My illness embarrassed me :’(
@ju52 it is a built-in statement of Go template , not Hugo functions.
ju52
October 2, 2019, 11:19am
7
must dive deeper in golang
Don’t forget to bring a couple of oxygen tanks with you.
2 Likes