I need help.
I need to use \"html/template\"
\'s marking ({{.Title}}
, example) in sub-files(\"article.html\"
, example in my text):
In your core.tmpl
you have to use
{{template "article" .}}
If you don't specify the .
at the end, the template will be executed with nil
data. Specifying the .
will pass the value of .
to the invoked template.
Quoting from the text/template package documentation, Actions
section:
{{template "name"}}
The template with the specified name is executed with nil data.
{{template "name" pipeline}}
The template with the specified name is executed with dot set
to the value of the pipeline.