From 012c6453c8dc4abfd1cea13ba4df1837e1338fa1 Mon Sep 17 00:00:00 2001 From: bouncepaw Date: Thu, 14 Jan 2021 16:39:54 +0500 Subject: [PATCH] Improve prev/next links --- templates/http_readers.qtpl | 4 ++-- templates/http_readers.qtpl.go | 4 ++-- util/util.go | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/http_readers.qtpl b/templates/http_readers.qtpl index 54b0a5a..6d7f861 100644 --- a/templates/http_readers.qtpl +++ b/templates/http_readers.qtpl @@ -41,10 +41,10 @@ If `contents` == "", a helpful message is shown instead.
{% if prevHyphaName != "" %} - ← {%s path.Base(prevHyphaName) %} + {% endif %} {% if nextHyphaName != "" %} - {%s path.Base(nextHyphaName) %} → + {% endif %}

diff --git a/templates/http_readers.qtpl.go b/templates/http_readers.qtpl.go index 1bf5e48..bedfc91 100644 --- a/templates/http_readers.qtpl.go +++ b/templates/http_readers.qtpl.go @@ -195,7 +195,7 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi //line templates/http_readers.qtpl:44 qw422016.E().S(prevHyphaName) //line templates/http_readers.qtpl:44 - qw422016.N().S(`">← `) + qw422016.N().S(`" rel="prev">← `) //line templates/http_readers.qtpl:44 qw422016.E().S(path.Base(prevHyphaName)) //line templates/http_readers.qtpl:44 @@ -214,7 +214,7 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi //line templates/http_readers.qtpl:47 qw422016.E().S(nextHyphaName) //line templates/http_readers.qtpl:47 - qw422016.N().S(`">`) + qw422016.N().S(`" rel="next">`) //line templates/http_readers.qtpl:47 qw422016.E().S(path.Base(nextHyphaName)) //line templates/http_readers.qtpl:47 diff --git a/util/util.go b/util/util.go index a77e2eb..e593f70 100644 --- a/util/util.go +++ b/util/util.go @@ -4,7 +4,6 @@ import ( "crypto/rand" "encoding/hex" "net/http" - "path" "strings" ) @@ -62,5 +61,5 @@ func BeautifulName(uglyName string) string { if uglyName == "" { return uglyName } - return strings.Title(strings.ReplaceAll(path.Base(uglyName), "_", " ")) + return strings.Title(strings.ReplaceAll(uglyName, "_", " ")) }