]> Sergey Matveev's repositories - sgblog.git/blob - cmd/sgblog/http-index.tmpl
6056fc7b7ae607f3c151d3da37cafdb289eb6063
[sgblog.git] / cmd / sgblog / http-index.tmpl
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5     <meta name="generator" content="SGBlog {{.Version}}">
6     <title>{{.Cfg.Title}} {{if .Topic}}(topic: {{.Topic}}) {{end}}({{.Offset}}-{{.OffsetNext}})</title>
7     {{with .Cfg.CSS}}<link rel="stylesheet" type="text/css" href="{{.}}">{{end}}
8     {{with .Cfg.Webmaster}}<link rev="made" href="mailto:{{.}}">{{end}}
9     {{range .Cfg.GitURLs}}<link rel="vcs-git" href="{{.}}" title="{{$.T.Get "Git repository"}}">{{end}}
10     <link rel="top" href="{{.Cfg.URLPrefix}}/" title="{{$.T.Get "top"}}">
11     <link rel="alternate" title="{{$.T.Get "Posts feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomPostsFeed}}{{if .Topic}}?topic={{.Topic}}{{end}}" type="application/atom+xml">
12     {{if .CommentsEnabled}}<link rel="alternate" title="{{$.T.Get "Comments feed"}}" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomCommentsFeed}}" type="application/atom+xml">{{end}}
13     {{if .Offset}}<link rel="prev" href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "prev"}}">{{end}}
14     {{if not .LogEnded}}<link rel="next" href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="{{$.T.Get "next"}}">{{end}}
15 </head>
16 <body>
17 {{with .Cfg.AboutURL}}[<a href="{{.}}">{{$.T.Get "about"}}</a>]{{end}}
18 {{block "links" .}}
19 {{if .Offset}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}">{{$.T.Get "prev"}}</a>]{{end}}
20 {{if not .LogEnded}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}">{{$.T.Get "next"}}</a>]{{end}}
21 {{end}}
22 {{if .Topics}}<hr/>
23 {{$.T.Get "Topics"}}: [<tt><a href="{{$.Cfg.URLPrefix}}/">{{$.T.Get "ALL"}}</a></tt>]
24 {{range .Topics}}[<tt><a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a></tt>]
25 {{end}}
26 {{end}}
27 {{- $TopicsEnabled := .TopicsEnabled -}}
28 {{- $datePrev := "0001-01-01" -}}
29 <table border=1>
30 <tr>
31     <th>N</th><th>{{$.T.Get "When"}}</th><th>{{$.T.Get "Title"}}</th>
32     <th size="5%"><a title="{{$.T.Get "Lines"}}">L</a></th>
33     <th size="5%"><a title="{{$.T.Get "Comments"}}">C</a></th>
34     <th>{{$.T.Get "Linked to"}}</th>
35     {{if .TopicsEnabled}}<th>{{$.T.Get "Topics"}}</th>{{end}}
36 </tr>
37 {{range .Entries -}}
38 {{- $dateCur := .Commit.Author.When.Format "2006-01-02" -}}
39 {{- if ne $dateCur $datePrev -}}
40     <tr><td colspan={{if $TopicsEnabled}}7{{else}}7{{end}}><center><tt>{{$dateCur}}</tt></center></td></tr>
41     {{- $datePrev = $dateCur -}}
42 {{- end -}}
43 <tr>
44     <td>{{.Num}}</td>
45     <td><tt>{{.Commit.Author.When.Format "15:04"}}</tt></td>
46     <td><a href="{{$.Cfg.URLPrefix}}/{{.Commit.Hash.String}}">{{.Title}}</a></td>
47     <td>{{.LinesNum}}</td>
48     <td>{{if .CommentsNum}}{{.CommentsNum}}{{else}}&nbsp;{{end}}</td>
49     <td>{{if .DomainURLs}}{{range .DomainURLs}} {{.}} {{end}}{{else}}&nbsp;{{end}}</td>
50     {{if $TopicsEnabled}}<td>{{if .Topics}}{{range .Topics}} <a href="{{$.Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a> {{end}}{{else}}&nbsp;{{end}}</td>{{end}}
51 </tr>
52 {{end}}</table>
53 {{template "links" .}}
54 </body>
55 </html>