@@ -47,7 +47,7 @@ var (
const helloWorldString = "Hello, World!"
var (
- tmpl = template.Must(template.ParseFiles("templates/layout.html", "templates/fortune.html"))
+ tmpl = template.Must(template.ParseFiles("templates/fortune.html"))
db *sql.DB
@@ -1,14 +1,14 @@
-{{define "content"}}
+<!DOCTYPE html>
+<html>
+<head>
+<title>Fortunes</title>
+</head>
+<body>
<table>
-<tr>
-<th>id</th>
-<th>message</th>
-</tr>
+<tr><th>id</th><th>message</th></tr>
{{range .}}
-<td>{{.Id}}</td>
-<td>{{.Message}}</td>
+<tr><td>{{.Id}}</td><td>{{.Message}}</td></tr>
{{end}}
</table>
-{{end}}
+</body>
+</html>
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Fortunes</title>
-</head>
-<body>
-{{template "content" .}}
-</body>
-</html>
@@ -46,7 +46,7 @@ var (
db *pgx.ConnPool