mirror of
https://github.com/gojp/goreportcard.git
synced 2026-02-04 03:09:12 +08:00
correct the google analytics variable for several templates make about page dynamic to allow for custom google analytics code
19 lines
401 B
Go
19 lines
401 B
Go
package handlers
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"text/template"
|
|
)
|
|
|
|
// AboutHandler handles the about page
|
|
func AboutHandler(w http.ResponseWriter, r *http.Request) {
|
|
log.Println("Serving about page")
|
|
|
|
t := template.Must(template.New("about.html").Delims("[[", "]]").ParseFiles("templates/about.html"))
|
|
t.Execute(w, map[string]interface{}{
|
|
"google_analytics_key": googleAnalyticsKey,
|
|
})
|
|
return
|
|
}
|