personal page
This commit is contained in:
@@ -105,31 +105,7 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
mux.HandleFunc("GET /automation", func(w http.ResponseWriter, r *http.Request) {
|
||||
tmpl, err := template.ParseFS(staticRoot, "templates/main.html", "pages/automation.html")
|
||||
if err != nil {
|
||||
log.Println("parse error:", err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
data := struct {
|
||||
Title string
|
||||
Sub bool
|
||||
}{
|
||||
Title: "automation",
|
||||
Sub: true,
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
// execute the base file by name — main.html is the entrypoint
|
||||
if err := tmpl.ExecuteTemplate(w, "main.html", data); err != nil {
|
||||
log.Println("execute error:", err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
|
||||
mux.HandleFunc("GET /interests", func(w http.ResponseWriter, r *http.Request) {
|
||||
mux.HandleFunc("GET /personal", func(w http.ResponseWriter, r *http.Request) {
|
||||
tmpl, err := template.ParseFS(staticRoot, "templates/main.html", "pages/interests.html")
|
||||
if err != nil {
|
||||
log.Println("parse error:", err)
|
||||
@@ -141,7 +117,7 @@ func main() {
|
||||
Title string
|
||||
Sub bool
|
||||
}{
|
||||
Title: "interests",
|
||||
Title: "personal",
|
||||
Sub: true,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user