con un clic
templ-http
// Integrate templ components with Go HTTP server using net/http. Use when connecting templ to web server, creating HTTP handlers, mentions 'templ server', 'HTTP routes', or 'serve templ components'.
// Integrate templ components with Go HTTP server using net/http. Use when connecting templ to web server, creating HTTP handlers, mentions 'templ server', 'HTTP routes', or 'serve templ components'.
A warm, Gruvbox-rooted design system derived from xeiaso.net. Use for personal-blog, technical-educator, or character-driven content that wants serif headlines, parchment surfaces, and chat-bubble layouts. Distinctive: magenta inverted link hovers, boxy 2px-radius sticker avatars, no gradients except the SponsorCard top rule.
Write GORM data access code using the DAO (Data Access Object) pattern. Use when creating database models, writing queries, setting up GORM, adding CRUD methods, or working with gorm.io in Go services. Also use when the user mentions "DAO", "data access", "ORM", "database models", "GORM", or is building a Go service that talks to a relational database.
Create reusable templ UI components with props, children, and composition patterns. Use when building UI components, creating component libraries, mentions 'button component', 'card component', or 'reusable templ components'.
Build interactive hypermedia-driven applications with templ and HTMX. Use when creating dynamic UIs, real-time updates, AJAX interactions, mentions 'HTMX', 'dynamic content', or 'interactive templ app'.
Learn and write templ component syntax including expressions, conditionals, loops, and Go integration. Use when writing .templ files, learning templ syntax, or mentions 'templ component', 'templ expressions', or '.templ file syntax'.
Write Go code following the conventions and patterns used in the within.website/x repository, including CLI patterns, error handling, logging with slog, HTTP handlers, and testing.
| name | templ-http |
| description | Integrate templ components with Go HTTP server using net/http. Use when connecting templ to web server, creating HTTP handlers, mentions 'templ server', 'HTTP routes', or 'serve templ components'. |
Use progressive disclosure: begin with the handler pattern, then add routing and middleware only as needed.
Use this skill when serving templ from net/http.
r.Context().func homeHandler(w http.ResponseWriter, r *http.Request) {
if err := components.HomePage().Render(r.Context(), w); err != nil {
http.Error(w, "render failed", http.StatusInternalServerError)
return
}
}
http.NewServeMux() and explicit handlers.r.Method when endpoint serves multiple actions.r.URL.Query()), form (r.ParseForm() + FormValue), path segments.http.FileServer and a dedicated prefix.func usersHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case http.MethodGet:
users := listUsers(r.Context())
_ = components.UserList(users).Render(r.Context(), w)
default:
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
}
}
templ-components.templ-htmx..templ: use templ-syntax.resources/handlers-and-routing.mdresources/middleware-and-errors.mdresources/request-and-response-patterns.mdnet/http: https://pkg.go.dev/net/http