cmd/sgblog/gopher.go | 33 +++++++++++++++++++++++++++------ common.go | 2 +- diff --git a/cmd/sgblog/gopher.go b/cmd/sgblog/gopher.go index fb882b638e30d05edac4c71c3eac5f5dd2e387b4123201a76480d3ad8d8557d9..0191d4ceadfd95ed324676b8145f3ae73f5028dfe91eec31fd5c5253a09f1409 100644 --- a/cmd/sgblog/gopher.go +++ b/cmd/sgblog/gopher.go @@ -107,8 +107,9 @@ } yearCur, monthCur, dayCur := commit.Author.When.Date() if dayCur != dayPrev || monthCur != monthPrev || yearCur != yearPrev { menu.WriteString(fmt.Sprintf( - "i%04d-%02d-%02d\t\tnull.host\t1%s", - yearCur, monthCur, dayCur, CRLF, + "i%04d-%02d-%02d\tnil\t%s\t%d%s", + yearCur, monthCur, dayCur, + cfg.GopherDomain, 70, CRLF, )) yearPrev, monthPrev, dayPrev = yearCur, monthCur, dayCur } @@ -131,14 +132,18 @@ )) } fmt.Printf( - "i%s (%d-%d)\t\tnull.host\t1%s", + "i%s (%d-%d)\tnil\t%s\t%d%s", cfg.Title, offset, offset+PageEntries, - CRLF, + cfg.GopherDomain, 70, CRLF, ) if cfg.AboutURL != "" { - fmt.Printf("iAbout: %s\t\tnull.host\t1%s", cfg.AboutURL, CRLF) + fmt.Printf( + "hAbout\tURL:%s\t%s\t%d%s", + cfg.AboutURL, + cfg.GopherDomain, 70, CRLF, + ) } if offset > 0 { offsetPrev := offset - PageEntries @@ -159,8 +164,24 @@ cfg.GopherDomain, 70, CRLF, ) } fmt.Print(menu.String()) - fmt.Printf("iGenerated by: SGBlog %s\t\tnull.host\t1%s", sgblog.Version, CRLF) + fmt.Printf( + "iGenerated by: SGBlog %s\terr\t%s\t%d%s", + sgblog.Version, + cfg.GopherDomain, 70, CRLF, + ) fmt.Print("." + CRLF) + } else if strings.HasPrefix(selector, "URL:") { + selector = selector[len("URL:"):] + fmt.Printf(` + + + Redirect to non-gopher URL + + +Redirecting to %s... + + +`, selector, selector, selector) } else if sha1DigestRe.MatchString(selector) { commit, err := repo.CommitObject(plumbing.NewHash(selector[1:])) if err != nil { diff --git a/common.go b/common.go index ca197e2a7db225582e1aac92a7a2fc92b716dc45bdba46358522960e72c392a7..b51b201b769e2b7c971b6fefcdf787a0592463bafc2afc9fbbe8db6273b3a760 100644 --- a/common.go +++ b/common.go @@ -2,6 +2,6 @@ // SGBlog -- Git-based CGI/inetd blogging/phlogging engine package sgblog const ( - Version = "0.4.0" + Version = "0.5.0" WhenFmt = "2006-01-02 15:04:05Z07:00" )