]> Sergey Matveev's repositories - sgblog.git/blobdiff - cmd/sgblog/gemini.go
Images in gopher/gemini
[sgblog.git] / cmd / sgblog / gemini.go
index 1b1131bcc67d5f0b418a13d278ff8d138fa23d03..527874eae26488228777311f4369c0745da12d73 100644 (file)
@@ -131,9 +131,10 @@ func serveGemini(cfgPath string) {
                        }
                        lines := msgSplit(commit.Message)
                        entries = append(entries, TableMenuEntry{
-                               Commit:   commit,
-                               Title:    lines[0],
-                               LinesNum: len(lines) - 2,
+                               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,
                                ))),
@@ -185,6 +186,7 @@ func serveGemini(cfgPath string) {
                        When         string
                        Cfg          *Cfg
                        Note         string
+                       Images       []Img
                        Comments     []string
                        Topics       []string
                        Version      string
@@ -196,6 +198,7 @@ func serveGemini(cfgPath string) {
                        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,