Commit c0b0fe0

Eric Bower  ·  2023-08-06 10:32:20 -0400 EDT
parent ad355eb
changes
2 files changed,  +20, -15
+8, -4
......@@ -5,13 +5,17 @@
55 {{define "content"}}
66 {{template "header" .}}
77
8- <h2>branches</h2>
8+ <h2 class="text-md">branches</h2>
9+ <ol>
910 {{range .Data.Branches}}
10- <p>{{.Refspec}}</p>
11+ <li>{{.Refspec}}</li>
1112 {{end}}
13+ </ol>
1214
13- <h2>tags</h2>
15+ <h2 class="text-md">tags</h2>
16+ <ol>
1417 {{range .Data.Tags}}
15- <p>{{.Refspec}}</p>
18+ <li>{{.Refspec}}</li>
1619 {{end}}
20+ </ol>
1721 {{end}}
+12, -11
......@@ -20,7 +20,7 @@ var defaultBranches = []string{"main", "master"}
2020 type RepoItemData struct {
2121 URL string
2222 Name string
23- Desc string
23+ Desc string
2424 CommitDate string
2525 LastCommit *git.Commit
2626 }
......@@ -46,13 +46,13 @@ type CommitData struct {
4646 }
4747
4848 type TreeItem struct {
49- NumLines int
50- URL string
51- Path string
52- Entry *git.TreeEntry
49+ NumLines int
50+ URL string
51+ Path string
52+ Entry *git.TreeEntry
5353 CommitURL string
54- Desc string
55- When string
54+ Desc string
55+ When string
5656 }
5757
5858 type PageData struct {
......@@ -68,7 +68,7 @@ type PageData struct {
6868
6969 type CommitPageData struct {
7070 CommitMsg template.HTML
71- CommitID string
71+ CommitID string
7272 Commit *CommitData
7373 Diff *DiffRender
7474 Repo *RepoData
......@@ -348,6 +348,7 @@ func (c *Config) writeLogDiffs(repo *git.Repository, pageData *PageData) {
348348 content += fmt.Sprintf("%s\n", line.Content)
349349 }
350350 }
351+ // set filename to something our `ParseText` recognizes (e.g. `.diff`)
351352 finContent, err := pastes.ParseText("commit.diff", content)
352353 bail(err)
353354
......@@ -358,7 +359,7 @@ func (c *Config) writeLogDiffs(repo *git.Repository, pageData *PageData) {
358359
359360 commitData := &CommitPageData{
360361 Commit: commit,
361- CommitID: commit.ID.String()[:7],
362+ CommitID: commit.ID.String()[:7],
362363 Diff: rnd,
363364 Repo: pageData.Repo,
364365 Parent: parentID[:7],
......@@ -482,7 +483,7 @@ func (c *Config) writeBranch(repo *git.Repository, pageData *PageData) *BranchOu
482483 bail(err)
483484
484485 var lc *git.Commit
485- if (len(lastCommits) > 0) {
486+ if len(lastCommits) > 0 {
486487 lc = lastCommits[0]
487488 }
488489 entry.CommitURL = commitURL(pageData.Repo.Name, lc.ID.String())
......@@ -545,7 +546,7 @@ func main() {
545546 repoList = append(repoList, &RepoItemData{
546547 URL: url,
547548 Name: name,
548- Desc: r.Desc,
549+ Desc: r.Desc,
549550 CommitDate: timediff.TimeDiff(mainOutput.LastCommit.Author.When),
550551 LastCommit: mainOutput.LastCommit,
551552 })