mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-12-07 00:48:07 +00:00
Backlinks: Isolate
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/bouncepaw/mycorrhiza/hyphae/backlinks"
|
||||
"github.com/bouncepaw/mycorrhiza/viewutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"github.com/bouncepaw/mycorrhiza/l18n"
|
||||
"github.com/bouncepaw/mycorrhiza/util"
|
||||
"github.com/bouncepaw/mycorrhiza/views"
|
||||
)
|
||||
|
||||
func initBacklinks(r *mux.Router) {
|
||||
r.PathPrefix("/backlinks/").HandlerFunc(handlerBacklinks)
|
||||
}
|
||||
|
||||
// handlerBacklinks lists all backlinks to a hypha.
|
||||
func handlerBacklinks(w http.ResponseWriter, rq *http.Request) {
|
||||
var (
|
||||
hyphaName = util.HyphaNameFromRq(rq, "backlinks")
|
||||
lc = l18n.FromRequest(rq)
|
||||
)
|
||||
util.HTTP200Page(w, views.Base(
|
||||
viewutil.MetaFrom(w, rq),
|
||||
lc.Get("ui.backlinks_title", &l18n.Replacements{"query": util.BeautifulName(hyphaName)}),
|
||||
views.Backlinks(hyphaName, backlinks.YieldHyphaBacklinks, lc),
|
||||
))
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/bouncepaw/mycorrhiza/backlinks"
|
||||
"github.com/bouncepaw/mycorrhiza/categories"
|
||||
"github.com/bouncepaw/mycorrhiza/misc"
|
||||
"io"
|
||||
@@ -47,7 +48,7 @@ func Handler() http.Handler {
|
||||
initMutators(wikiRouter)
|
||||
initHistory(wikiRouter)
|
||||
initHelp(wikiRouter)
|
||||
initBacklinks(wikiRouter)
|
||||
backlinks.InitHandlers(wikiRouter)
|
||||
categories.InitHandlers(wikiRouter)
|
||||
misc.InitHandlers(wikiRouter)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user