36 lines
685 B
Go
36 lines
685 B
Go
package frontend
|
|
|
|
import (
|
|
"html/template"
|
|
"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")
|
|
err := home.Execute(w, struct {
|
|
Name string
|
|
}{
|
|
Name: "Miau",
|
|
})
|
|
if err != nil {
|
|
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
|
|
}
|
|
}
|