Improve serach function with quick suggestions

This commit is contained in:
2026-05-18 15:10:34 +02:00
parent 8244874fe3
commit a25d5434ac
8 changed files with 545 additions and 61 deletions
+6 -1
View File
@@ -98,6 +98,7 @@ func main() {
}))
http.HandleFunc("/_logout", h.handleLogout)
http.HandleFunc("/_reindex", h.handleReindex)
http.HandleFunc("/_search", h.handleSearchSuggest)
http.HandleFunc("/quickadd", h.handleQuickAdd)
http.Handle("/", h)
@@ -284,9 +285,13 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
rawContent = "# " + heading + "\n\n"
}
parent := ""
if urlPath != "/" {
parent = parentURL(urlPath)
}
data := pageData{
Title: title,
Crumbs: buildCrumbs(urlPath),
ParentURL: parent,
CanEdit: true,
EditMode: editMode,
IsRoot: urlPath == "/",