diff --git a/src/routes/root.go b/src/routes/root.go index 950afeb..ad7dd9b 100644 --- a/src/routes/root.go +++ b/src/routes/root.go @@ -14,7 +14,7 @@ func RootHandler(w http.ResponseWriter, r *http.Request) { Title: "Home Page", } - tmpl, err := template.ParseFiles("web/views/#layout.html", "web/views/index.html", "web/views/#header.html") + tmpl, err := template.ParseFiles("web/views/#layout.html", "web/views/index.html", "web/views/#header.html", "web/views/#footer.html") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return diff --git a/web/views/#footer.html b/web/views/#footer.html new file mode 100644 index 0000000..0a66b30 --- /dev/null +++ b/web/views/#footer.html @@ -0,0 +1,5 @@ +{{define "footer"}} + + {{end}} \ No newline at end of file diff --git a/web/views/#layout.html b/web/views/#layout.html index b1c5619..884f5d3 100644 --- a/web/views/#layout.html +++ b/web/views/#layout.html @@ -12,6 +12,7 @@ {{template "header" .}} {{template "view" .}} + {{template "footer" .}} {{end}} diff --git a/web/views/index.html b/web/views/index.html index 2b4eaf6..7d481d9 100644 --- a/web/views/index.html +++ b/web/views/index.html @@ -14,8 +14,4 @@ Another Example Route can be found here - - {{end}}