summaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-18 21:00:36 +0530
committerLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-18 21:00:36 +0530
commit089ada4cac4dd900646c2039960214f549bed058 (patch)
treeefccfa5fc7354750f4efcd5b1479f0ff31546ae6 /routes
parent0e6eaa211357cd5b9de1762b1cb49e47d35580dc (diff)
downloadlegit-089ada4cac4dd900646c2039960214f549bed058.tar.gz
legit-089ada4cac4dd900646c2039960214f549bed058.tar.bz2
legit-089ada4cac4dd900646c2039960214f549bed058.zip
config: fix go-import pretty url
Diffstat (limited to 'routes')
-rw-r--r--routes/routes.go9
1 files changed, 6 insertions, 3 deletions
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(`<meta name="go-import" content="%s git %s">`,
- d.c.Misc.GoImport.PrettyURL, cloneURL)
+ prettyURL, cloneURL)
tpath := filepath.Join(d.c.Dirs.Templates, "*")
t := template.Must(template.ParseGlob(tpath))