Render default route on "/"
This commit is contained in:
@@ -89,6 +89,7 @@ type HtmxRoute interface {
|
|||||||
GetHtmx(language Language, queryParams ...HtmxPathParam) gomponents.Node
|
GetHtmx(language Language, queryParams ...HtmxPathParam) gomponents.Node
|
||||||
SetActivePath(activePath *ActivePath) HtmxRoute
|
SetActivePath(activePath *ActivePath) HtmxRoute
|
||||||
Add(server *http.ServeMux)
|
Add(server *http.ServeMux)
|
||||||
|
Execute(c HtmxContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addLanguageToPath(path string, language Language) string {
|
func addLanguageToPath(path string, language Language) string {
|
||||||
@@ -102,6 +103,10 @@ type HtmxGetRoute struct {
|
|||||||
ActivePath *ActivePath
|
ActivePath *ActivePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h HtmxGetRoute) Execute(c HtmxContext) {
|
||||||
|
h.RouteFunc(c)
|
||||||
|
}
|
||||||
|
|
||||||
func (h HtmxGetRoute) SetActivePath(activePath *ActivePath) HtmxRoute {
|
func (h HtmxGetRoute) SetActivePath(activePath *ActivePath) HtmxRoute {
|
||||||
h.ActivePath = activePath
|
h.ActivePath = activePath
|
||||||
return h
|
return h
|
||||||
|
|||||||
Reference in New Issue
Block a user