mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Improve prev/next links
This commit is contained in:
parent
fe43c1e8f8
commit
012c6453c8
@ -41,10 +41,10 @@ If `contents` == "", a helpful message is shown instead.
|
|||||||
</article>
|
</article>
|
||||||
<section class="prevnext">
|
<section class="prevnext">
|
||||||
{% if prevHyphaName != "" %}
|
{% if prevHyphaName != "" %}
|
||||||
<a class="prevnext__el prevnext__prev" href="/page/{%s prevHyphaName %}">← {%s path.Base(prevHyphaName) %}</a>
|
<a class="prevnext__el prevnext__prev" href="/page/{%s prevHyphaName %}" rel="prev">← {%s path.Base(prevHyphaName) %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if nextHyphaName != "" %}
|
{% if nextHyphaName != "" %}
|
||||||
<a class="prevnext__el prevnext__next" href="/page/{%s nextHyphaName %}">{%s path.Base(nextHyphaName) %} →</a>
|
<a class="prevnext__el prevnext__next" href="/page/{%s nextHyphaName %}" rel="next">{%s path.Base(nextHyphaName) %} →</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
<hr class="page-separator"/>
|
<hr class="page-separator"/>
|
||||||
|
@ -195,7 +195,7 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi
|
|||||||
//line templates/http_readers.qtpl:44
|
//line templates/http_readers.qtpl:44
|
||||||
qw422016.E().S(prevHyphaName)
|
qw422016.E().S(prevHyphaName)
|
||||||
//line templates/http_readers.qtpl:44
|
//line templates/http_readers.qtpl:44
|
||||||
qw422016.N().S(`">← `)
|
qw422016.N().S(`" rel="prev">← `)
|
||||||
//line templates/http_readers.qtpl:44
|
//line templates/http_readers.qtpl:44
|
||||||
qw422016.E().S(path.Base(prevHyphaName))
|
qw422016.E().S(path.Base(prevHyphaName))
|
||||||
//line templates/http_readers.qtpl:44
|
//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
|
//line templates/http_readers.qtpl:47
|
||||||
qw422016.E().S(nextHyphaName)
|
qw422016.E().S(nextHyphaName)
|
||||||
//line templates/http_readers.qtpl:47
|
//line templates/http_readers.qtpl:47
|
||||||
qw422016.N().S(`">`)
|
qw422016.N().S(`" rel="next">`)
|
||||||
//line templates/http_readers.qtpl:47
|
//line templates/http_readers.qtpl:47
|
||||||
qw422016.E().S(path.Base(nextHyphaName))
|
qw422016.E().S(path.Base(nextHyphaName))
|
||||||
//line templates/http_readers.qtpl:47
|
//line templates/http_readers.qtpl:47
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -62,5 +61,5 @@ func BeautifulName(uglyName string) string {
|
|||||||
if uglyName == "" {
|
if uglyName == "" {
|
||||||
return uglyName
|
return uglyName
|
||||||
}
|
}
|
||||||
return strings.Title(strings.ReplaceAll(path.Base(uglyName), "_", " "))
|
return strings.Title(strings.ReplaceAll(uglyName, "_", " "))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user