Go master pages example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ANALYTICS HERE --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{define "title"}}Home page{{end}} | |
{{define "body"}} | |
Welcome to the home page! | |
{{end}} | |
{{template "masterpage_layout.html"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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