Add a logo

This commit is contained in:
Tom Wiesing 2023-02-10 12:01:06 +01:00
parent 5339c442b7
commit b1009fa109
No known key found for this signature in database
18 changed files with 240 additions and 112 deletions

View file

@ -30,6 +30,7 @@ var aboutTemplate = template.Must(template.New("about.html").Parse(aboutHTML))
// aboutContext is passed to about.html
type aboutContext struct {
Instances []status.WissKI
Logo template.HTML
SelfRedirect string
}
@ -41,6 +42,8 @@ type publicContext struct {
About template.HTML
}
const logoHTML = template.HTML(`<img src="/logo.svg" alt="WissKI Distillery Logo" class="biglogo">`)
func (home *Home) publicHandler(ctx context.Context) http.Handler {
tpl := publicTemplate.Prepare(
@ -63,6 +66,7 @@ func (home *Home) publicHandler(ctx context.Context) http.Handler {
defer pools.ReleaseBuilder(builder)
// prepare about
pc.aboutContext.Logo = logoHTML
pc.aboutContext.Instances = home.homeInstances.Get(nil)
pc.aboutContext.SelfRedirect = home.Config.SelfRedirect.String()