Wiki Links support

This commit is contained in:
2026-04-21 19:50:16 +02:00
parent 9639a70572
commit e0d2fb0b41
7 changed files with 478 additions and 5 deletions
+13
View File
@@ -51,6 +51,8 @@ func main() {
log.Fatal(err)
}
initMarkdown(root)
authKey, err := loadOrCreateAuthKey(root)
if err != nil {
log.Fatal(err)
@@ -183,6 +185,7 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
Crumbs: buildCrumbs(urlPath),
CanEdit: true,
EditMode: editMode,
IsRoot: urlPath == "/",
SectionIndex: sectionIndex,
PostURL: urlPath,
RawContent: rawContent,
@@ -198,6 +201,16 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
}
func (h *handler) handlePost(w http.ResponseWriter, r *http.Request, urlPath, fsPath string) {
query := r.URL.Query()
if query.Has("delete") {
h.handleDelete(w, r, urlPath, fsPath)
return
}
if _, ok := query["move"]; ok {
h.handleMove(w, r, urlPath, fsPath, query.Get("move"))
return
}
if err := r.ParseForm(); err != nil {
http.Error(w, "bad request", http.StatusBadRequest)
return