summaryrefslogtreecommitdiffstats
path: root/routes/routes.go
diff options
context:
space:
mode:
authorLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-19 09:02:23 +0530
committerLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-19 09:02:23 +0530
commitdf0962a39ebef3853cbe90b3f7b07f7d2fce96d6 (patch)
treef293cb914ea3cf9da599a90b55793c8dbf5217c8 /routes/routes.go
parent232a3603a6dc67537109cec06e738b596265475c (diff)
downloadlegit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.tar.gz
legit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.tar.bz2
legit-df0962a39ebef3853cbe90b3f7b07f7d2fce96d6.zip
all: no more pretty urls
Diffstat (limited to 'routes/routes.go')
-rw-r--r--routes/routes.go20
1 files changed, 3 insertions, 17 deletions
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)