Template layout handlebars title not replacing properly.
pateljoel opened this issue · 3 comments
I'm using fiber for a small project and just started with the handlebars example.
I am trying to make the template work with the <title>{{title}}</title>
tag and it doesn't update instead the source shows <title></title>
which is what I don't understand.
Help would be appreciated.
@pateljoel can you try a variable name starting with capital letters in the map and in the template, maybe this is a golang problem, because you can only access variables that start with capital letters
@ReneWerner87 I have tried using captial letters myself and the title still didn't show up with the title "Homepage" this is the source output:
<html>
<title></title>
<body>
<div>
<div>index</div>
</div>
</body>
</html>
You can clone the test repo here pateljoel/gofiber-templating-title-issue and try reproducing the issue on your side.
Hi folks, I am having the same issue. I also tried the capital letters option as well, also without success. Not only title not being replaced, any var passed to the layout. Any recommendation on how to make this work?
Alternatively, I will stop using layouts as passing vars in the rest of the templates works fine.