package handlers import ( "html/template" "net/http" ) func JobsHandler(w http.ResponseWriter, r *http.Request) { if r.Header.Get("HX-Request") == "true" { // This is an HTMX request, return only the jobs partial tmpl := template.Must(template.ParseFiles("templates/partials/jobs.html")) jobs := []string{"Job 1", "Job 2", "Job 3"} // Replace with actual data fetching tmpl.Execute(w, jobs) } else { // This is a full page request tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/partials/jobs.html")) jobs := []string{"Job 1", "Job 2", "Job 3"} // Replace with actual data fetching tmpl.Execute(w, map[string]interface{}{ "Title": "Jobs", "Jobs": jobs, }) } }