delphi.market/server/router/pages/components/nav.templ

29 lines
578 B
Plaintext

package components
import c "git.ekzyis.com/ekzyis/delphi.market/server/router/context"
templ Nav() {
<header class="mt-3">
<nav
id="nav"
class="flex flex-row"
hx-target="#content"
hx-swap="outerHTML"
hx-select="#content"
hx-push-url="true"
>
<div>
<button hx-get="/">home</button>
</div>
<div class="ms-auto">
<button hx-get="/about">about</button>
if ctx.Value(c.SessionContextKey) != nil {
<button hx-get="/user">user</button>
} else {
<button hx-get="/signup">signup</button>
}
</div>
</nav>
</header>
}