package web import ( "html/template" "net/http" ) func GenericHandler(w http.ResponseWriter, r *http.Request) { tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/partials/generic.html")) data := map[string]interface{}{ "Title": "Generic Tools", } if r.Header.Get("HX-Request") == "true" { tmpl.ExecuteTemplate(w, "content", data) } else { tmpl.Execute(w, data) } }