diff options
Diffstat (limited to '')
-rw-r--r-- | cmd/web/handlers.go | 2 | ||||
-rw-r--r-- | ui/html/base.tmpl.html | 9 | ||||
-rw-r--r-- | ui/html/pages/home.tmpl.html | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index 7a8f79e..fd70c5e 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -31,7 +31,7 @@ func (app *application) home(w http.ResponseWriter, r *http.Request) { files := []string{ "./ui/html/base.tmpl.html", - // "./ui/html/pages/home.tmpl.html", + "./ui/html/pages/home.tmpl.html", // "./ui/html/partials/nav.tmpl.html", } diff --git a/ui/html/base.tmpl.html b/ui/html/base.tmpl.html index 77ea1e9..f7f7e48 100644 --- a/ui/html/base.tmpl.html +++ b/ui/html/base.tmpl.html @@ -4,10 +4,15 @@ <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width" /> - <title>DED</title> + <title>{{ template "title" .}} - DED</title> </head> <body> - <h1>Hello from DED!</h1> + <header> + <h1><a href="/">DED</a></h1> + </header> + <main> + {{ template "main" }} + </main> </body> </html> {{ end }} diff --git a/ui/html/pages/home.tmpl.html b/ui/html/pages/home.tmpl.html new file mode 100644 index 0000000..882a3ba --- /dev/null +++ b/ui/html/pages/home.tmpl.html @@ -0,0 +1,6 @@ +{{define "title"}}Home{{end}} + +{{ define "main" }} +<h2>Data</h2> +<p>There is nothing to see here yet.</p> +{{ end }} |