Added HTML
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user