From 089ada4cac4dd900646c2039960214f549bed058 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sun, 18 Dec 2022 21:00:36 +0530 Subject: config: fix go-import pretty url --- routes/routes.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'routes') diff --git a/routes/routes.go b/routes/routes.go index bb0d247..1edff21 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -114,13 +114,16 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) { } cloneURL := fmt.Sprintf("https://%s/%s", d.c.Server.FQDN, name) + prettyURL := d.c.Misc.GoImport.PrettyURL - if d.c.Misc.GoImport.PrettyURL == "" { - d.c.Misc.GoImport.PrettyURL = cloneURL + if prettyURL == "" { + prettyURL = cloneURL + } else { + prettyURL = filepath.Join(prettyURL, name) } goImport := fmt.Sprintf(``, - d.c.Misc.GoImport.PrettyURL, cloneURL) + prettyURL, cloneURL) tpath := filepath.Join(d.c.Dirs.Templates, "*") t := template.Must(template.ParseGlob(tpath)) -- cgit