Refactor Site-Wide Data
This commit is contained in:
parent
b7c55b07f9
commit
e5a5c64953
1 changed files with 5 additions and 3 deletions
8
view.go
8
view.go
|
@ -5,6 +5,7 @@ package main
|
|||
|
||||
import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
// "net/http"
|
||||
|
@ -266,12 +267,13 @@ type LayoutTemplateData struct {
|
|||
Data any
|
||||
}
|
||||
|
||||
func execTemplate(w http.ResponseWriter, t *template.Template, commonData *NestedCommonTplData, loginData *NestedLoginTplData, config ConfigFile, data any) error {
|
||||
func execTemplate(w http.ResponseWriter, t *template.Template, commonData NestedCommonTplData, loginData NestedLoginTplData, config ConfigFile, data any) error {
|
||||
commonData.WebsiteURL = config.WebAddress
|
||||
commonData.WebsiteName = config.Org
|
||||
log.Printf("execTemplate %v", commonData)
|
||||
return t.Execute(w, LayoutTemplateData{
|
||||
Common: *commonData,
|
||||
Login: *loginData,
|
||||
Common: commonData,
|
||||
Login: loginData,
|
||||
Data: data,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue