···11+// htmx contains a Handler function that handles the rendering of pages
22+// depending on received HTMX attributes.
33+//
44+// See: [Handler]
15package htmx
2637import (
···812 "github.com/STBoyden/go-portfolio/internal/pkg/routes/site/views"
913)
10141515+// Simple handler to optionally render views.Root alongside the provided
1616+// component depending on the HX-Request header. This provides the benefit of
1717+// being able to get a partial and a full page from the same endpoint, with the
1818+// decision being made on the presence of the header - allowing a cleaner SPA
1919+// feel.
1120func Handler(component templ.Component, options ...func(*templ.ComponentHandler)) http.Handler {
1221 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1322 render := component