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
}
}
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
)
}
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(`<html>
+<head>
+ <meta http-equiv="Refresh" content="1; url=%s" />
+ <title>Redirect to non-gopher URL</title>
+</head>
+<body>
+Redirecting to <a href="%s">%s</a>...
+</body>
+</html>
+`, selector, selector, selector)
} else if sha1DigestRe.MatchString(selector) {
commit, err := repo.CommitObject(plumbing.NewHash(selector[1:]))
if err != nil {