From a84ac778adf57d6446eef6577e617a80d4c6bb8e Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 19 Jul 2022 15:39:49 +0200 Subject: Ease packaging by making resource path configurable --- profile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'profile.go') diff --git a/profile.go b/profile.go index 603b10a..51f0b08 100644 --- a/profile.go +++ b/profile.go @@ -22,7 +22,7 @@ type ProfileTplData struct { } func handleProfile(w http.ResponseWriter, r *http.Request) { - templateProfile := template.Must(template.ParseFiles("templates/layout.html", "templates/profile.html")) + templateProfile := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/profile.html")) login := checkLogin(w, r) if login == nil { @@ -97,7 +97,7 @@ type PasswdTplData struct { } func handlePasswd(w http.ResponseWriter, r *http.Request) { - templatePasswd := template.Must(template.ParseFiles("templates/layout.html", "templates/passwd.html")) + templatePasswd := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/passwd.html")) login := checkLogin(w, r) if login == nil { -- cgit v1.2.3