all repos — elgit @ ef83d4e55a4b8a65c982bfb80c00b2b00950cf06

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

remove unnecessary displayname property

Alan Pearce
commit

ef83d4e55a4b8a65c982bfb80c00b2b00950cf06

parent

a943f744c1f12ceda9e066cfe350c1aa782f3290

4 files changed, 1 insertion(+), 15 deletions(-)

changed files
M routes/routes.goroutes/routes.go
@@ -94,7 +94,6 @@
pageData := templates.PageData{ Meta: d.c.Meta, Name: repoName, - DisplayName: getDisplayName(repoName), Ref: mainBranch, Description: getDescription(repoPath), Servername: d.c.Server.Name,
@@ -126,7 +125,6 @@ }
data := make(map[string]any) data["name"] = repoName - data["displayname"] = getDisplayName(repoName) data["ref"] = ref data["parent"] = treePath data["desc"] = getDescription(repoPath)
@@ -160,7 +158,6 @@ return err
} data := make(map[string]any) data["name"] = repoName - data["displayname"] = getDisplayName(repoName) data["ref"] = ref data["desc"] = getDescription(repoPath) data["path"] = treePath
@@ -242,7 +239,6 @@
pageData := templates.PageData{ Meta: d.c.Meta, Name: repoName, - DisplayName: getDisplayName(repoName), Ref: ref, Description: getDescription(repoPath), Log: true,
@@ -273,7 +269,6 @@ Meta: d.c.Meta,
Name: repoName, Stat: diff.Stat, Diff: diff.Diff, - DisplayName: getDisplayName(repoName), Ref: ref, Description: getDescription(repoPath), }
@@ -303,7 +298,6 @@ }
pageData := templates.PageData{ Meta: d.c.Meta, - DisplayName: getDisplayName(repoName), Name: repoName, Ref: ref, Description: getDescription(repoPath),
@@ -339,7 +333,6 @@
pageData := templates.PageData{ Meta: d.c.Meta, Name: repoName, - DisplayName: getDisplayName(repoName), Description: getDescription(repoPath), }
M routes/template.goroutes/template.go
@@ -36,7 +36,6 @@
func (d *deps) listFiles(files []git.NiceTree, data map[string]any, rc *atreugo.RequestCtx) error { pageData := templates.PageData{ Meta: d.c.Meta, - DisplayName: data["displayname"].(string), Name: data["name"].(string), Ref: data["ref"].(string), Description: data["desc"].(string),
@@ -119,7 +118,6 @@ }
pageData := templates.PageData{ Meta: d.c.Meta, - DisplayName: getDisplayName(data["name"].(string)), LineCount: lines, Content: content, RenderedContent: renderedContent,
M routes/util.goroutes/util.go
@@ -21,10 +21,6 @@
return has } -func getDisplayName(name string) string { - return strings.TrimSuffix(name, ".git") -} - func getDescription(path string) (desc string) { db, err := os.ReadFile(filepath.Join(path, "description")) if err == nil {
M templates/page.gotemplates/page.go
@@ -18,7 +18,6 @@ }
type PageData struct { Meta config.Meta - DisplayName string Name string Ref string Description string
@@ -65,7 +64,7 @@ func RepoHeader(data PageData) g.Node {
return Header( H2( A(Href("/"), g.Text("all repos")), - g.Textf(" — %s", data.DisplayName), + g.Textf(" — %s", data.Name), g.If(data.Ref != "", Span(Class("ref"), g.Textf(" @ %s", data.Ref))), ), H3(Class("desc"), g.Text(data.Description)),