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

22 lines
549 B
Plaintext

package components
import c "git.ekzyis.com/ekzyis/delphi.market/server/router/context"
templ Header() {
<header class="mt-3">
<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="/login">login</button>
}
</div>
</nav>
</header>
}