Update help page

This commit is contained in:
Fred Boniface
2023-09-01 23:01:08 +01:00
parent 8e7350a355
commit cc08f8358e
3 changed files with 24 additions and 30 deletions

View File

@@ -1,7 +1,6 @@
package web
import (
"fmt"
"html/template"
"net/http"
@@ -23,14 +22,9 @@ func buildPage(w http.ResponseWriter, r *http.Request) {
BarcodeOptions: barcodeOptions,
}
tmpl, err := template.New("help").ParseFiles("templates/help.html") // Match template name and file name
if err != nil {
fmt.Println("Error templating page: ", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
tmpl := template.Must(template.New("help.html").ParseFiles("templates/help.html"))
err = tmpl.Execute(w, data)
err := tmpl.Execute(w, data)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return