This is my first stab at doing front end with Go. I have this template:
{{define "index"}}{{template "_header.html"}}
{{template "_message.html"}}
<div>Page Index</div>
<div>Welcome {{.Title}}</div>
{{template "_footer.html"}}
{{end}}
Where the {{.Title}}
works as expected.
But when I attempt to use it in an include file {template "_header.html"}
it fails.
{{define "_header.html"}}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="./css/css.css"/>
<title>{{.Title}}</title>
</head><body>{{end}}
Now the <title>
tag is empty.
Any advice?