From f33d7598acef8fa898c541a725d8cf534aece65c Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sat, 29 Aug 2020 00:43:36 +0500 Subject: [PATCH] A better navigation --- http_readers.go | 23 +++++++++++++++++------ metarrhiza | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/http_readers.go b/http_readers.go index 8c02a89..ec87d26 100644 --- a/http_readers.go +++ b/http_readers.go @@ -33,7 +33,6 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) { textPath = hyphaName + "&.gmi" textContents, err = history.FileAtRevision(textPath, revHash) ) - log.Println(revHash, hyphaName, textPath, textContents, err) if err == nil { contents = gemtext.ToHtml(hyphaName, textContents) } @@ -41,8 +40,11 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) {
@@ -58,7 +60,8 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) { `, hyphaName, naviTitle(hyphaName), contents, - tree.TreeAsHtml(hyphaName, IterateHyphaNamesWith)) + tree.TreeAsHtml(hyphaName, IterateHyphaNamesWith), + revHash) w.Header().Set("Content-Type", "text/html;charset=utf-8") w.WriteHeader(http.StatusOK) w.Write([]byte(base(hyphaName, form))) @@ -81,6 +84,14 @@ func handlerHistory(w http.ResponseWriter, rq *http.Request) { table := fmt.Sprintf(`
+ @@ -91,10 +102,10 @@ func handlerHistory(w http.ResponseWriter, rq *http.Request) { - %s + %[2]s
-
`, tbody) +
`, hyphaName, tbody) w.Header().Set("Content-Type", "text/html;charset=utf-8") w.WriteHeader(http.StatusOK) w.Write([]byte(base(hyphaName, table))) @@ -144,9 +155,9 @@ func handlerPage(w http.ResponseWriter, rq *http.Request) {
diff --git a/metarrhiza b/metarrhiza index 41b2e0b..2a36350 160000 --- a/metarrhiza +++ b/metarrhiza @@ -1 +1 @@ -Subproject commit 41b2e0bda18d1c4188363790fcd6289f29b296c3 +Subproject commit 2a36350d4248610d7e09119d03a602414252abe4