anubis/web/index.go
Jason Cameron 529f65674e
style: apply structpack & goimport (#469)
* refactor: reorder import statements in fetch.go and fetch_test.go

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

* fix: optimize struct field alignment to reduce memory usage

Signed-off-by: Jason Cameron <git@jasoncameron.dev>

---------

Signed-off-by: Jason Cameron <git@jasoncameron.dev>
2025-05-09 12:54:15 -04:00

34 lines
767 B
Go

package web
import (
"github.com/a-h/templ"
"github.com/TecharoHQ/anubis/lib/policy/config"
)
func Base(title string, body templ.Component) templ.Component {
return base(title, body, nil, nil)
}
func BaseWithChallengeAndOGTags(title string, body templ.Component, challenge string, rules *config.ChallengeRules, ogTags map[string]string) (templ.Component, error) {
return base(title, body, struct {
Rules *config.ChallengeRules `json:"rules"`
Challenge string `json:"challenge"`
}{
Challenge: challenge,
Rules: rules,
}, ogTags), nil
}
func Index() templ.Component {
return index()
}
func ErrorPage(msg string, mail string) templ.Component {
return errorPage(msg, mail)
}
func Bench() templ.Component {
return bench()
}