X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fsgblog%2Fgopher.go;h=2c8578fa6d9aaffa8cf0229d73e1f9a1a119713f;hb=bec350105fae0b0d2719a347c47929817ba57a7d;hp=966d94a19284106848d89e4a480c425230c102af;hpb=8ec70b5cbc17244bc3627bb7a99e27b94834d419;p=sgblog.git diff --git a/cmd/sgblog/gopher.go b/cmd/sgblog/gopher.go index 966d94a..2c8578f 100644 --- a/cmd/sgblog/gopher.go +++ b/cmd/sgblog/gopher.go @@ -33,6 +33,7 @@ import ( "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" + "github.com/vorlif/spreak" "go.stargrave.org/sgblog" ) @@ -62,6 +63,7 @@ func serveGopher(cfgPath string) { if cfg.GopherDomain == "" { log.Fatalln("GopherDomain is not configured") } + initLocalizer(cfg.Lang) headHash, err := initRepo(cfg) if err != nil { @@ -96,6 +98,7 @@ Redirecting to %s... log.Fatalln(err) } err = TmplGopherEntry.Execute(os.Stdout, struct { + T *spreak.Localizer Commit *object.Commit When string Cfg *Cfg @@ -105,6 +108,7 @@ Redirecting to %s... Version string TitleEscaped string }{ + T: localizer, Commit: commit, When: commit.Author.When.Format(sgblog.WhenFmt), Cfg: cfg, @@ -183,6 +187,7 @@ Redirecting to %s... offsetPrev = 0 } err = TmplGopherMenu.Execute(os.Stdout, struct { + T *spreak.Localizer Cfg *Cfg Topic string Offset int @@ -193,6 +198,7 @@ Redirecting to %s... Topics []string Version string }{ + T: localizer, Cfg: cfg, Topic: topic, Offset: offset,