Skip to content

Instantly share code, notes, and snippets.

@jpoehls
Created August 4, 2014 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpoehls/bc46397072eeb83eced8 to your computer and use it in GitHub Desktop.
Save jpoehls/bc46397072eeb83eced8 to your computer and use it in GitHub Desktop.
Go master pages example
<!-- ANALYTICS HERE -->
{{define "title"}}Home page{{end}}
{{define "body"}}
Welcome to the home page!
{{end}}
{{template "masterpage_layout.html"}}
// Pseudo syntax example.
func main() {
var writer io.Writer
var data interface{}
// viewengine.Text() is also available
engine := viewengine.Html().Funcs(...)
engine.Render(writer, "home.html", data)
}
<html>
<head>
<title>{{template "title"}}</title>
</head>
<body>
{{template "body"}}
{{template "analytics.html"}}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment