diff --git a/routes.go b/routes.go index fd84f12..a4a04d4 100644 --- a/routes.go +++ b/routes.go @@ -26,8 +26,8 @@ func healthcheck(w http.ResponseWriter, r *http.Request) { // // Static content for the about page. func about(w http.ResponseWriter, r *http.Request) { - tmpl, _ := template.New("about.html.tmpl").ParseFiles("templates/about.html.tmpl") - tmpl.Execute(w, nil) + tmpl, _ := template.New("about").ParseFiles("templates/about.html.tmpl", "templates/base.html.tmpl") + tmpl.ExecuteTemplate(w, "base", nil) } // Feeds list @@ -41,8 +41,8 @@ func listContent(w http.ResponseWriter, r *http.Request) { links = append(links, formattedItems...) } - tmpl, _ := template.New("index.html.tmpl").ParseFiles("templates/index.html.tmpl") - tmpl.Execute(w, links) + tmpl, _ := template.New("base").ParseFiles("templates/index.html.tmpl", "templates/base.html.tmpl") + tmpl.ExecuteTemplate(w, "base", links) } // Manage content @@ -74,6 +74,6 @@ func manageContent(w http.ResponseWriter, r *http.Request) { Feeds map[string]string } - tmpl, _ := template.New("manage.html.tmpl").ParseFiles("templates/manage.html.tmpl") - tmpl.Execute(w, ManageTmplData{Feeds: allFeeds}) + tmpl, _ := template.New("manage").ParseFiles("templates/manage.html.tmpl", "templates/base.html.tmpl") + tmpl.ExecuteTemplate(w, "base", ManageTmplData{Feeds: allFeeds}) } diff --git a/templates/about.html.tmpl b/templates/about.html.tmpl index 5b1728d..3a8cb47 100644 --- a/templates/about.html.tmpl +++ b/templates/about.html.tmpl @@ -1,22 +1,5 @@ - -
-