Migrate from templates to Gomponents (#103)
This commit is contained in:
parent
0bf9ab7189
commit
051d032038
104 changed files with 2768 additions and 2824 deletions
19
pkg/ui/components/nav.go
Normal file
19
pkg/ui/components/nav.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package components
|
||||
|
||||
import (
|
||||
"github.com/mikestefanello/pagoda/pkg/ui"
|
||||
. "maragu.dev/gomponents"
|
||||
. "maragu.dev/gomponents/html"
|
||||
)
|
||||
|
||||
func MenuLink(r *ui.Request, title, routeName string, routeParams ...any) Node {
|
||||
href := r.Path(routeName, routeParams...)
|
||||
|
||||
return Li(
|
||||
A(
|
||||
Href(href),
|
||||
Text(title),
|
||||
If(href == r.CurrentPath, Class("is-active")),
|
||||
),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue