mirror of
https://github.com/mentos1386/zdravko.git
synced 2025-01-18 18:47:16 +00:00
25 lines
507 B
Go
25 lines
507 B
Go
package pages
|
|
|
|
import (
|
|
"net/http"
|
|
"text/template"
|
|
|
|
"code.tjo.space/mentos1386/zdravko/internal"
|
|
)
|
|
|
|
func Index(w http.ResponseWriter, r *http.Request) {
|
|
ts, err := template.ParseFS(internal.Templates,
|
|
"ui/components/base.tmpl",
|
|
"ui/components/icon.tmpl",
|
|
"ui/pages/index.tmpl",
|
|
)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
|
|
err = ts.ExecuteTemplate(w, "base", nil)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
}
|
|
}
|