all repos — elgit @ 089ada4cac4dd900646c2039960214f549bed058

fork of legit: web frontend for git, written in go

config: fix go-import pretty url

commit

089ada4cac4dd900646c2039960214f549bed058

parent

0e6eaa211357cd5b9de1762b1cb49e47d35580dc

1 file changed, 6 insertions(+), 3 deletions(-)

changed files
M routes/routes.goroutes/routes.go
@@ -114,13 +114,16 @@ return
} 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))