In the main template I call the sub template:
<div id="nav">
{{template "nav" ("posts")}}
</div>
In the sub template I have following if statement:
{{if eq . "posts"}}
<a href="/posts" class="btn active"><img src="icn/post.svg"><p>test</p></a>
{{else}}
<a href="/posts" class="btn"><img src="icn/post.svg"></a>
{{end}}
But I get an error when executing:
template: nav.html:3:5: executing “nav” at <eq . “posts”>: error calling eq: invalid type for comparison
What am I doing wrong? The argument “post” is transmitted to the sub template and visible in the sub template.
TIA