diff options
Diffstat (limited to 'web/index.go')
| -rw-r--r-- | web/index.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/web/index.go b/web/index.go index 5d2957b..ac4cbda 100644 --- a/web/index.go +++ b/web/index.go @@ -2,14 +2,22 @@ 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) + return base(title, body, nil, nil) } -func BaseWithOGTags(title string, body templ.Component, ogTags map[string]string) templ.Component { - return base(title, body, ogTags) +func BaseWithChallengeAndOGTags(title string, body templ.Component, challenge string, rules *config.ChallengeRules, ogTags map[string]string) (templ.Component, error) { + return base(title, body, struct { + Challenge string `json:"challenge"` + Rules *config.ChallengeRules `json:"rules"` + }{ + Challenge: challenge, + Rules: rules, + }, ogTags), nil } func Index() templ.Component { |
