]> Sergey Matveev's repositories - sgblog.git/blob - cmd/sgblog/gopher-menu.tmpl
Move templates to external files, make them HTML5
[sgblog.git] / cmd / sgblog / gopher-menu.tmpl
1 {{$CR := printf "\r"}}{{$CRLF := printf "\r\n" -}}
2 {{- define "domainPort" }}      {{.GopherDomain}}       70{{end}}{{$Cfg := .Cfg -}}
3 i{{.Cfg.Title}} {{if .Topic}}(topic: {{.Topic}}) {{end}}({{.Offset}}-{{.OffsetNext}})   err{{template "domainPort" .Cfg}}{{$CRLF -}}
4 {{- if .Cfg.AboutURL}}hAbout    URL:{{.Cfg.AboutURL}}{{template "domainPort" .Cfg}}{{$CRLF}}{{end -}}
5 {{- if .Offset}}1Prev   {{if .Topic}}{{.Topic}}/{{end}}offset/{{.OffsetPrev}}{{template "domainPort" .Cfg}}{{$CRLF}}{{end -}}
6 {{- if not .LogEnded}}1Next     {{if .Topic}}{{.Topic}}/{{end}}offset/{{.OffsetNext}}{{template "domainPort" .Cfg}}{{$CRLF}}{{end -}}
7 {{- $datePrev := "0001-01-01" -}}
8 {{- range .Entries -}}
9 {{- $dateCur := .Commit.Author.When.Format "2006-01-02" -}}
10 {{- if ne $dateCur $datePrev}}{{$datePrev = $dateCur}}
11 i{{$dateCur}}   err{{template "domainPort" $Cfg}}{{$CR}}{{end}}
12 0[{{.Commit.Author.When.Format "15:04"}}] {{.Title}} ({{.LinesNum}}L){{with .CommentsNum}} ({{.}}C){{end}}{{if .Topics}}{{range .Topics}} {{.}}{{end}}{{end}}   /{{.Commit.Hash.String}}{{template "domainPort" $Cfg}}{{$CR}}{{end}}
13 {{range .Topics}}
14 1Topic: {{.}}   {{.}}/offset/0{{template "domainPort" $Cfg}}{{$CR}}{{end}}
15 iGenerated by: SGBlog {{.Version}}      err{{template "domainPort" .Cfg}}{{$CR}}
16 .{{$CRLF}}