]> Sergey Matveev's repositories - sgblog.git/blob - cmd/sgblog/http-index.tmpl
Move templates to external files, make them HTML5
[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="Git repository">{{end}}
10     <link rel="top" href="{{.Cfg.URLPrefix}}/" title="top">
11     <link rel="alternate" title="Posts feed" href="{{.Cfg.AtomBaseURL}}{{.Cfg.URLPrefix}}/{{.AtomPostsFeed}}{{if .Topic}}?topic={{.Topic}}{{end}}" type="application/atom+xml">
12     {{if .CommentsEnabled}}<link rel="alternate" title="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="prev">{{end}}
14     {{if not .LogEnded}}<link rel="next" href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}" title="next">{{end}}
15 </head>
16 <body>
17 {{with .Cfg.AboutURL}}[<a href="{{.}}">about</a>]{{end}}
18 {{block "links" .}}
19 {{if .Offset}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetPrev}}{{if .Topic}}&topic={{.Topic}}{{end}}">prev</a>]{{end}}
20 {{if not .LogEnded}}[<a href="{{.Cfg.URLPrefix}}/?offset={{.OffsetNext}}{{if .Topic}}&topic={{.Topic}}{{end}}">next</a>]{{end}}
21 {{end}}
22 {{- $Cfg := .Cfg -}}
23 {{if .Topics}}<hr/>
24 Topics: [<tt><a href="{{$Cfg.URLPrefix}}/">ALL</a></tt>]
25 {{range .Topics}}[<tt><a href="{{$Cfg.URLPrefix}}?topic={{.}}">{{.}}</a></tt>]
26 {{end}}
27 {{end}}
28 {{- $TopicsEnabled := .TopicsEnabled -}}
29 {{- $datePrev := "0001-01-01" -}}
30 <table border=1>
31 <tr>
32     <th>N</th><th>When</th><th>Title</th>
33     <th size="5%"><a title="Lines">L</a></th>
34     <th size="5%"><a title="Comments">C</a></th>
35     <th>Linked to</th>
36     {{if .TopicsEnabled}}<th>Topics</th>{{end}}
37 </tr>
38 {{range .Entries -}}
39 {{- $dateCur := .Commit.Author.When.Format "2006-01-02" -}}
40 {{- if ne $dateCur $datePrev -}}
41     <tr><td colspan={{if $TopicsEnabled}}7{{else}}7{{end}}><center><tt>{{$dateCur}}</tt></center></td></tr>
42     {{- $datePrev = $dateCur -}}
43 {{- end -}}
44 <tr>
45     <td>{{.Num}}</td>
46     <td><tt>{{.Commit.Author.When.Format "15:04"}}</tt></td>
47     <td><a href="{{$Cfg.URLPrefix}}/{{.Commit.Hash.String}}">{{.Title}}</a></td>
48     <td>{{.LinesNum}}</td>
49     <td>{{if .CommentsNum}}{{.CommentsNum}}{{else}}&nbsp;{{end}}</td>
50     <td>{{if .DomainURLs}}{{range .DomainURLs}} {{.}} {{end}}{{else}}&nbsp;{{end}}</td>
51     {{if $TopicsEnabled}}<td>{{if .Topics}}{{range .Topics}} <a href="{{$Cfg.URLPrefix}}/?topic={{.}}">{{.}}</a> {{end}}{{else}}&nbsp;{{end}}</td>{{end}}
52 </tr>
53 {{end}}</table>
54 {{template "links" .}}
55 </body>
56 </html>