Is it possible for me to set a variable in a template file {{$title := "Login"}}
then parse it through to another file included using {{template "header" .}}
?
An example of what I'm attempting:
header.tmpl
{{define "header"}}
<title>{{.title}}</title>
{{end}}
login.tmpl
{{define "login"}}
<html>
<head>
{{$title := "Login"}}
{{template "header" .}}
</head>
<body>
Login Body!
</body>
</html>
{{end}}
How can I parse this custom $title variable I made through to my header template?