diff --git a/src/routes/template.go b/src/routes/template.go index 1d45647..a534019 100644 --- a/src/routes/template.go +++ b/src/routes/template.go @@ -9,16 +9,16 @@ type PageData struct { Title string } -func renderTemplate(w http.ResponseWriter, data PageData, specificTemplate string) { +func renderTemplate(w http.ResponseWriter, data PageData, view string) { // List of common templates - commonTemplates := []string{ - "web/views/#layout.html", - "web/views/#header.html", - "web/views/#footer.html", + layout := []string{ + "web/views/template/#layout.html", + "web/views/template/#header.html", + "web/views/template/#footer.html", } // Append the specific template for the route - templates := append(commonTemplates, specificTemplate) + templates := append(layout, view) // Parse all templates tmpl, err := template.ParseFiles(templates...) diff --git a/web/views/#footer.html b/web/views/template/#footer.html similarity index 100% rename from web/views/#footer.html rename to web/views/template/#footer.html diff --git a/web/views/#header.html b/web/views/template/#header.html similarity index 100% rename from web/views/#header.html rename to web/views/template/#header.html diff --git a/web/views/#layout.html b/web/views/template/#layout.html similarity index 100% rename from web/views/#layout.html rename to web/views/template/#layout.html