X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fsgblog%2Fgopher.go;fp=cmd%2Fsgblog%2Fgopher.go;h=c70a84d00bf40a364871c3a51b0a751097353c4f;hb=fb473fd627f8b146f56e69548998f870ce8f6976;hp=ffa259c135a588e920c045b86fbc764fc01b26f4;hpb=392291e2888eab29f07cff1cfae4e6d69aef3ccc;p=sgblog.git diff --git a/cmd/sgblog/gopher.go b/cmd/sgblog/gopher.go index ffa259c..c70a84d 100644 --- a/cmd/sgblog/gopher.go +++ b/cmd/sgblog/gopher.go @@ -51,6 +51,7 @@ type TableMenuEntry struct { Commit *object.Commit Title string LinesNum int + ImagesNum int CommentsNum int Topics []string } @@ -103,6 +104,7 @@ Redirecting to %s... When string Cfg *Cfg Note string + Images []Img Comments []string Topics []string Version string @@ -113,6 +115,7 @@ Redirecting to %s... When: commit.Author.When.Format(sgblog.WhenFmt), Cfg: cfg, Note: string(sgblog.GetNote(repo, notesTree, commit.Hash)), + Images: listImgs(cfg, commit.Hash), Comments: sgblog.ParseComments(sgblog.GetNote(repo, commentsTree, commit.Hash)), Topics: sgblog.ParseTopics(sgblog.GetNote(repo, topicsTree, commit.Hash)), Version: sgblog.Version, @@ -175,11 +178,16 @@ Redirecting to %s... } lines := msgSplit(commit.Message) entries = append(entries, TableMenuEntry{ - Commit: commit, - Title: lines[0], - LinesNum: len(lines) - 2, - CommentsNum: len(sgblog.ParseComments(sgblog.GetNote(repo, commentsTree, commit.Hash))), - Topics: sgblog.ParseTopics(sgblog.GetNote(repo, topicsTree, commit.Hash)), + Commit: commit, + Title: lines[0], + LinesNum: len(lines) - 2, + ImagesNum: len(listImgs(cfg, commit.Hash)), + CommentsNum: len(sgblog.ParseComments(sgblog.GetNote( + repo, commentsTree, commit.Hash, + ))), + Topics: sgblog.ParseTopics(sgblog.GetNote( + repo, topicsTree, commit.Hash, + )), }) } offsetPrev := offset - PageEntries