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