personal page

This commit is contained in:
samantha42
2026-09-10 12:38:57 +02:00
parent e063f20c92
commit 6de9ed4069
6 changed files with 20 additions and 31 deletions
+2 -26
View File
@@ -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,
}