Documentation
¶
Overview ¶
templ: version: v0.3.1070
templ: version: v0.3.1070
templ: version: v0.3.1070
templ: version: v0.3.1070
templ: version: v0.3.1070
Index ¶
- Variables
- func DeployTarget(active DeployTargetProps) templ.Component
- func HelloWorld(props HelloWorldProps) templ.Component
- func ImageDemo(props ImageDemoProps) templ.Component
- func LazyLoad(isFirstLoad LazyLoadProps) templ.Component
- func McpSetup(active McpSetupProps) templ.Component
- type DeployTargetProps
- type HelloWorldProps
- type ImageDemoProps
- type LazyLoadProps
- type McpSetupProps
Constants ¶
This section is empty.
Variables ¶
View Source
var DeployTargetConfig = routes.RouteConfig[DeployTargetProps]{ Type: routes.DYNAMIC, HttpMethod: routes.GET, Middleware: func(w http.ResponseWriter, r *http.Request) DeployTargetProps { target := r.URL.Query().Get("target") switch target { case "gcp", "server": return target default: return "aws" } }, }
View Source
var HelloWorldConfig = routes.RouteConfig[HelloWorldProps]{ Type: routes.STATIC, HttpMethod: routes.GET, Middleware: func(w http.ResponseWriter, r *http.Request) HelloWorldProps { return nil }, }
View Source
var ImageDemoConfig = routes.RouteConfig[ImageDemoProps]{ Type: routes.STATIC, HttpMethod: routes.GET, Middleware: func(w http.ResponseWriter, r *http.Request) ImageDemoProps { return nil }, }
View Source
var LazyLoadConfig = routes.RouteConfig[LazyLoadProps]{ Type: routes.STATIC, HttpMethod: routes.GET, Middleware: func(w http.ResponseWriter, r *http.Request) LazyLoadProps { return false }, }
*
- `LazyLoadConfig` sets up a static route for the lazy-loaded component. *
- - `Type`: Set to `STATIC` so responses can be cached by CDNs like CloudFront.
- - `HttpMethod`: Uses `GET`, which aligns with HTMX's default behavior for fetching content.
- - `Middleware`: In this case, always returns `false`: because it is only called via HTMX
- after the initial placeholder render, meaning this is *not* the first load. *
- Note: The first render with `true` should be triggered from a parent component or page.
View Source
var McpSetupConfig = routes.RouteConfig[McpSetupProps]{ Type: routes.DYNAMIC, HttpMethod: routes.GET, Middleware: func(w http.ResponseWriter, r *http.Request) McpSetupProps { client := r.URL.Query().Get("client") switch client { case "opencode", "codex", "cursor": return client default: return "claude" } }, }
Functions ¶
func DeployTarget ¶
func DeployTarget(active DeployTargetProps) templ.Component
func HelloWorld ¶
func HelloWorld(props HelloWorldProps) templ.Component
func ImageDemo ¶
func ImageDemo(props ImageDemoProps) templ.Component
func LazyLoad ¶
func LazyLoad(isFirstLoad LazyLoadProps) templ.Component
func McpSetup ¶
func McpSetup(active McpSetupProps) templ.Component
Types ¶
type DeployTargetProps ¶
type DeployTargetProps = string
type HelloWorldProps ¶
type HelloWorldProps = interface{}
type ImageDemoProps ¶
type ImageDemoProps = interface{}
type LazyLoadProps ¶
type LazyLoadProps = bool
*
- `LazyLoadProps` defines the props passed to the `LazyLoad` component. *
- It is a simple boolean value:
- - `true` indicates the initial (placeholder) render: usually triggered from a full page render.
- - `false` indicates the second load: when HTMX fetches the full content.
type McpSetupProps ¶
type McpSetupProps = string
Click to show internal directories.
Click to hide internal directories.