Add map section with geocoded family pins

This commit is contained in:
Ian Gulliver
2026-08-15 23:21:03 -07:00
parent c56310d219
commit fd52c948db
11 changed files with 350 additions and 13 deletions
+5 -3
View File
@@ -23,11 +23,12 @@ var legacy = map[string]string{
}
type app struct {
cache *Cache
cache *Cache
mapsKey string
}
func Register(mux *http.ServeMux, cache *Cache) {
a := app{cache: cache}
func Register(mux *http.ServeMux, cache *Cache, mapsKey string) {
a := app{cache: cache, mapsKey: mapsKey}
for _, section := range sections {
mux.HandleFunc("GET /"+section, a.page)
}
@@ -60,6 +61,7 @@ func (a app) page(w http.ResponseWriter, r *http.Request) {
"UserName": name,
"UserInitial": strings.ToUpper(name[:1]),
"UserEmail": auth.Email(r),
"MapsKey": a.mapsKey,
}
if err := t.Execute(w, data); err != nil {
log.Printf("[ERROR] render directory page: %v", err)