diff --git a/routes/routes.go b/routes/routes.go
index 3124d1b..4d99ab0 100644
--- a/routes/routes.go
+++ b/routes/routes.go
@@ -151,6 +151,7 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) {
data["commits"] = commits
data["desc"] = getDescription(path)
data["servername"] = d.c.Server.Name
+ data["gomod"] = isGoModule(gr)
if err := t.ExecuteTemplate(w, "repo", data); err != nil {
log.Println(err)
diff --git a/routes/util.go b/routes/util.go
index d3f80fe..e6a6267 100644
--- a/routes/util.go
+++ b/routes/util.go
@@ -3,8 +3,15 @@ package routes
import (
"os"
"path/filepath"
+
+ "git.icyphox.sh/legit/git"
)
+func isGoModule(gr *git.GitRepo) bool {
+ _, err := gr.FileContent("go.mod")
+ return err == nil
+}
+
func getDescription(path string) (desc string) {
db, err := os.ReadFile(filepath.Join(path, "description"))
if err == nil {
diff --git a/templates/head.html b/templates/head.html
index ea910dc..53487eb 100644
--- a/templates/head.html
+++ b/templates/head.html
@@ -5,7 +5,7 @@
- {{ if .servername }}
+ {{ if and .servername .gomod }}
{{ end }}