fixing search

This commit is contained in:
2025-01-12 01:12:14 +01:00
parent cf4c1c3557
commit 3e808899c1
2 changed files with 13 additions and 2 deletions

View File

@@ -31,8 +31,17 @@ func (app *App) UpSearch(w http.ResponseWriter, req *http.Request) {
}
// render template
t := template.Must(template.ParseFiles("assets/templates/article.html"))
err = t.ExecuteTemplate(w, "content", articleVMs)
t := template.Must(template.ParseFiles(
"assets/templates/article.html",
"assets/templates/layout.html",
"assets/templates/components/pagination.html"))
data := map[string]interface{}{
"SelectedNavItemArticle": true,
"ArticleVMs": &articleVMs,
"Paginations": nil,
}
err = t.ExecuteTemplate(w, "base", data)
if err != nil {
http.Error(w, "Failed to render template", http.StatusInternalServerError)
return