From e9dc433ca52eaa469c01887f6080cad4478d10b3 Mon Sep 17 00:00:00 2001 From: Robert Iannucci Date: Tue, 26 Sep 2017 19:30:09 -0700 Subject: [PATCH] Make meta refresh go directly to the subpackage. (#11) Fixes #10 --- handler.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/handler.go b/handler.go index bfe3f32..6f5a3f9 100644 --- a/handler.go +++ b/handler.go @@ -84,7 +84,7 @@ func newHandler(config []byte) (*handler, error) { func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { current := r.URL.Path - pc, _ := h.paths.find(current) + pc, subpath := h.paths.find(current) if pc == nil && current == "/" { h.serveIndex(w, r) return @@ -96,11 +96,13 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if err := vanityTmpl.Execute(w, struct { Import string + Subpath string Repo string Display string VCS string }{ Import: h.Host(r) + pc.path, + Subpath: subpath, Repo: pc.repo, Display: pc.display, VCS: pc.vcs, @@ -149,10 +151,10 @@ var vanityTmpl = template.Must(template.New("vanity").Parse(` - + -Nothing to see here; see the package on godoc. +Nothing to see here; see the package on godoc. `))