minimal template introducing
parent
0bf1182c91
commit
4d07761bd5
|
@ -25,7 +25,7 @@ type Page struct {
|
|||
|
||||
// Render the page
|
||||
func (p *Page) Render(w http.ResponseWriter, templates ...string) (int, error) {
|
||||
templates = append(templates, "header", "footer")
|
||||
templates = append(templates, "base_full")
|
||||
var tpl *template.Template
|
||||
|
||||
for i, t := range templates {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
{{ define "header" }}
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="en">
|
||||
<head>
|
||||
|
@ -21,4 +20,9 @@
|
|||
<header class="site-header">
|
||||
Admin
|
||||
</header>
|
||||
{{ end }}
|
||||
|
||||
{{ template "content" . }}
|
||||
|
||||
<footer></footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
{{ template "content" . }}
|
|
@ -1,5 +0,0 @@
|
|||
{{ define "footer" }}
|
||||
<footer></footer>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
|
@ -1,4 +1,4 @@
|
|||
{{ template "header" . }}
|
||||
{{ define "content" }}
|
||||
|
||||
{{ with .Body }}
|
||||
<div class="content">
|
||||
|
@ -9,4 +9,4 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ template "footer" . }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue