all repos — elgit @ df0962a39ebef3853cbe90b3f7b07f7d2fce96d6

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

all: no more pretty urls

commit

df0962a39ebef3853cbe90b3f7b07f7d2fce96d6

parent

232a3603a6dc67537109cec06e738b596265475c

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

changed files
M routes/routes.goroutes/routes.go
@@ -1,7 +1,6 @@
package routes import ( - "fmt" "html/template" "log" "net/http"
@@ -10,10 +9,10 @@ "path/filepath"
"sort" "time" + "git.icyphox.sh/legit/config" + "git.icyphox.sh/legit/git" "github.com/alexedwards/flow" "github.com/dustin/go-humanize" - "icyphox.sh/legit/config" - "icyphox.sh/legit/git" ) type deps struct {
@@ -113,18 +112,6 @@ log.Println(err)
return } - cloneURL := fmt.Sprintf("https://%s/%s", d.c.Server.FQDN, name) - prettyURL := d.c.Misc.GoImport.PrettyURL - - if prettyURL == "" { - prettyURL = cloneURL - } else { - prettyURL = filepath.Join(prettyURL, name) - } - - goImport := fmt.Sprintf(`<meta name="go-import" content="%s git %s">`, - prettyURL, cloneURL) - tpath := filepath.Join(d.c.Dirs.Templates, "*") t := template.Must(template.ParseGlob(tpath))
@@ -138,8 +125,7 @@ data["ref"] = mainBranch
data["readme"] = readmeContent data["commits"] = commits data["desc"] = getDescription(path) - data["clone"] = cloneURL - data["goimport"] = template.HTML(goImport) + data["servername"] = d.c.Server.Name if err := t.ExecuteTemplate(w, "repo", data); err != nil { log.Println(err)