cmd/sgblog/gopher.go | 33 ++++++++++++++++----------------- diff --git a/cmd/sgblog/gopher.go b/cmd/sgblog/gopher.go index ae8efd8e2231a696887c789e4296dd37a2b16bc3ebb3e912841466e1aa096d70..fb882b638e30d05edac4c71c3eac5f5dd2e387b4123201a76480d3ad8d8557d9 100644 --- a/cmd/sgblog/gopher.go +++ b/cmd/sgblog/gopher.go @@ -130,38 +130,36 @@ cfg.GopherDomain, 70, CRLF, )) } - var links bytes.Buffer + fmt.Printf( + "i%s (%d-%d)\t\tnull.host\t1%s", + cfg.Title, + offset, + offset+PageEntries, + CRLF, + ) + if cfg.AboutURL != "" { + fmt.Printf("iAbout: %s\t\tnull.host\t1%s", cfg.AboutURL, CRLF) + } if offset > 0 { offsetPrev := offset - PageEntries if offsetPrev < 0 { offsetPrev = 0 } - links.WriteString(fmt.Sprintf( + fmt.Printf( "1Prev\toffset/%d\t%s\t%d%s", offsetPrev, cfg.GopherDomain, 70, CRLF, - )) + ) } if !logEnded { - links.WriteString(fmt.Sprintf( + fmt.Printf( "1Next\toffset/%d\t%s\t%d%s", offset+PageEntries, cfg.GopherDomain, 70, CRLF, - )) + ) } - - fmt.Printf( - "i%s (%d-%d)\t\tnull.host\t1%s", - cfg.Title, - offset, - offset+PageEntries, - CRLF, - ) - if cfg.AboutURL != "" { - fmt.Printf("iAbout: %s\t\tnull.host\t1%s", cfg.AboutURL, CRLF) - } - fmt.Print(links.String()) fmt.Print(menu.String()) + fmt.Printf("iGenerated by: SGBlog %s\t\tnull.host\t1%s", sgblog.Version, CRLF) fmt.Print("." + CRLF) } else if sha1DigestRe.MatchString(selector) { commit, err := repo.CommitObject(plumbing.NewHash(selector[1:])) @@ -182,6 +180,7 @@ } for i, comment := range parseComments(getNote(commentsTree, commit.Hash)) { fmt.Printf("%s\ncomment %d:\n%s\n", DashLine, i, comment) } + fmt.Printf("%s\nGenerated by: SGBlog %s\n", DashLine, sgblog.Version) } else { log.Fatalln(errors.New("unknown selector")) }