whatdahey

This commit is contained in:
Bel LaPointe
2022-02-16 07:57:25 -07:00
parent 9923b182f4
commit 552a3f46ff
2 changed files with 5 additions and 4 deletions

View File

@@ -216,10 +216,10 @@ func (server *Server) uiSearchHandler(w http.ResponseWriter, r *http.Request) er
}
data := make([]struct {
Title string
ID string
ID ID
}, len(idsTitles))
for i := range idsTitles {
data[i].ID = idsTitles[i][0]
data[i].ID = NewID(idsTitles[i][0])
data[i].Title = idsTitles[i][1]
}
tree := server.tree()
@@ -278,8 +278,8 @@ func (server *Server) uiFilesHandler(w http.ResponseWriter, r *http.Request) err
"This": map[string]string{
"Title": leaf.Title,
"Content": leaf.Content,
"ID": r.URL.Path,
"PID": strings.TrimPrefix(path.Dir(r.URL.Path), "/"),
"ID": ID,
"PID": ID.Pop(),
"PTitle": parent.Title,
},
"Tree": string(branchesJSON),