Added HTML

This commit is contained in:
2026-06-05 19:00:48 +02:00
parent 0a44df319d
commit 1a0797ef19
9 changed files with 265 additions and 2 deletions

View File

@@ -5,10 +5,14 @@ import (
"net/http"
)
var dashbaord = template.Must(template.ParseFiles(
"frontend/htmx/contents/dash/base.html",
"frontend/htmx/contents/dash/dashboard.html"))
var home = template.Must(template.ParseFiles("frontend/htmx/home.html"))
func Home(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
var tmpl = template.Must(template.ParseFiles("frontend/htmx/home.html"))
err := tmpl.Execute(w, struct {
err := home.Execute(w, struct {
Name string
}{
Name: "Miau",
@@ -17,3 +21,15 @@ func Home(w http.ResponseWriter, r *http.Request) {
return
}
}
func Dashboard(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
err := dashbaord.Execute(w, struct {
Title string
}{
Title: "Miau",
})
if err != nil {
return
}
}