rename web dir to assets
This commit is contained in:
@@ -36,7 +36,7 @@ func Index(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
// render template
|
||||
t := template.Must(template.ParseFiles("web/templates/article.html", "web/templates/layout.html"))
|
||||
t := template.Must(template.ParseFiles("assets/templates/article.html", "assets/templates/layout.html"))
|
||||
err = t.ExecuteTemplate(w, "base", articleVMs)
|
||||
if err != nil { http.Error(w, "Failed to render template", http.StatusInternalServerError); return; }
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ func UpSearch(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
// render template
|
||||
t := template.Must(template.ParseFiles("web/templates/article.html"))
|
||||
t := template.Must(template.ParseFiles("assets/templates/article.html"))
|
||||
err = t.ExecuteTemplate(w, "content", articleVMs)
|
||||
if err != nil { http.Error(w, "Failed to render template", http.StatusInternalServerError); return; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user