perf: embed challenge data in HTML (#279)

This commit is contained in:
Ryan Cao
2025-04-18 04:06:37 +00:00
committed by GitHub
parent 736c3ade09
commit f844dba3dc
7 changed files with 63 additions and 42 deletions

View File

@@ -5,7 +5,7 @@ import (
"github.com/TecharoHQ/anubis/xess"
)
templ base(title string, body templ.Component, ogTags map[string]string) {
templ base(title string, body templ.Component, challenge any, ogTags map[string]string) {
<!DOCTYPE html>
<html lang="en">
<head>
@@ -56,6 +56,9 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
}
</style>
@templ.JSONScript("anubis_version", anubis.Version)
if challenge != nil {
@templ.JSONScript("anubis_challenge", challenge)
}
</head>
<body id="top">