diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-19 09:02:23 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-19 09:02:23 +0530 |
commit | df0962a39ebef3853cbe90b3f7b07f7d2fce96d6 (patch) | |
tree | f293cb914ea3cf9da599a90b55793c8dbf5217c8 /routes | |
parent | 232a3603a6dc67537109cec06e738b596265475c (diff) | |
download | legit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.tar.gz legit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.tar.bz2 legit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.zip |
all: no more pretty urls
Diffstat (limited to '')
-rw-r--r-- | routes/handler.go | 2 | ||||
-rw-r--r-- | routes/routes.go | 20 | ||||
-rw-r--r-- | routes/template.go | 2 |
3 files changed, 5 insertions, 19 deletions
diff --git a/routes/handler.go b/routes/handler.go index d230773..c0b146c 100644 --- a/routes/handler.go +++ b/routes/handler.go @@ -5,9 +5,9 @@ import ( "net/http" "path/filepath" + "git.icyphox.sh/legit/config" "github.com/alexedwards/flow" "github.com/sosedoff/gitkit" - "icyphox.sh/legit/config" ) type depsWrapper struct { diff --git a/routes/routes.go b/routes/routes.go index 1edff21..7ec2178 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -1,7 +1,6 @@ package routes import ( - "fmt" "html/template" "log" "net/http" @@ -10,10 +9,10 @@ import ( "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 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) { 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 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) { 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) diff --git a/routes/template.go b/routes/template.go index 6af5cfe..d3e0cef 100644 --- a/routes/template.go +++ b/routes/template.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - "icyphox.sh/legit/git" + "git.icyphox.sh/legit/git" ) func (d *deps) Write404(w http.ResponseWriter) { |