gtx


  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{{.Title}}</title>
    <style>
      html {
        font: medium/normal serif;
      }
      caption {
        caption-side: bottom;
      }
    </style>
  </head>
  <body>
    <header>
      <h1><a href="/">{{with .Data.Project}}{{.}}{{else}}Home{{end}}</a></h1>
      {{- range .Data.Breadcrumbs}}
        <span>{{.}}</span>
      {{- end}}
    </header>
    <main>
      <hr>
      {{- with .Data.Link}}
      <h2>Repository</h2>
      <p>Clone this repo using: <code>git clone {{.}}</code></p>
      {{- end}}

      {{- with $list := .Data.Branches}}
      <h2>Branches</h2>
      {{- range $list}}
      <details open>
        <summary><a href="/branch/{{.Name}}/">{{.Name}}</a></summary>
        {{- with and (len .Commits) (index .Commits 0) }}
        <dl>
          <dt>Subject</dt>
          <dd>{{.Subject}}</dd>
          <dt>Author</dt>
          <dd>{{.Author.Name}} <{{.Author.Email}}></dd>
          <dt>Date</dt>
          <dd>
            <time datetime="{{.Date.Format "2006-01-02"}}">{{.Date.Format "Jan. 02 '06 15:04:05"}}</time>
          </dd>
        </dl>
        {{- end}}
      </details>
      {{- end}}
      {{- end}}

      {{- with $list := .Data.Commits}}
      <table>
        <caption>{{len $list}} commits total</caption>
        <thead>
          <tr>
            <th>Date</th>
            <th>Commit</th>
            <th>Subject</th>
            <th>Author</th>
          </tr>
        </thead>
        <tbody>
        {{- range $list}}
          <tr>
            <td>
              <time datetime="{{.Date.Format "2006-01-02"}}">{{.Date.Format "01/02/06 15:04"}}</time>
            </td>
            <td><code>{{.Abbr}}</code></td>
            <td><a href="/commit/{{.Hash}}/">{{.Subject}}</a></td>
            <td><a href="mailto:{{.Author.Email}}">{{.Author.Name}}</a></td>
          </tr>
        {{- end}}
        </tbody>
      </table>
      {{- end}}

      {{- with .Data.Commit}}
      <h2>Branch: <a href="/branch/{{.Branch}}/">{{.Branch}}</a></h2>
      <dl>
        <dt>Author</dt>
        <dd>{{.Author.Name}} <{{.Author.Email}}></dd>
        <dt>Date</dt>
        <dd>{{.Date.Format "Jan. 02 '06 15:04:05"}}</dd>
        <dt>Commit</dt>
        <dd>{{.Hash}}</dd>
        {{- range .Parents }}
        <dt>Parent</dt>
        <dd>
          <a href="/commit/{{.}}">{{.}}</a>
          (<a href="/commit/{{$.Data.Commit.Hash}}/diff-to-{{.}}.html">diff to parent</a>)
        </dd>
        {{- end }}
        {{- with .Body }}
        <dt>Log message</dt>
        <dd><pre>{{.}}</pre></dd>
        {{- end }}
        <dt>Diff stat</dt>
        {{- range .History }}
        <dd><pre>{{.}}</pre></dd>
        {{- end }}
        <dt>Files</dt>
        {{- range .Tree}}
        <dd>
          <a href="/commit/{{$.Data.Commit.Hash}}/{{.Path}}.html">{{.Path}}</a>
          (<a href="/object/{{slice .Hash 0 2}}/{{.Hash}}" download="{{.Path}}">raw</a>)
        </dd>
        {{- end}}
      </dl>
      {{- end}}

      {{- with .Data.Diff}}
      {{- with .Commit}}
      <h2>Branch: <a href="/branch/{{.Branch}}/">{{.Branch}}</a></h2>
      <h3>Commit: <a href="/commit/{{.Hash}}/">{{.Hash}}</a></h3>
      <dl>
        <dt>Author</dt>
        <dd>{{.Author.Name}} <{{.Author.Email}}></dd>
        <dt>Date</dt>
        <dd>{{.Date.Format "Jan. 02 '06 15:04:05"}}</dd>
        <dt>Parent</dt>
        <dd>
          <a href="/commit/{{$.Data.Diff.Parent}}">{{$.Data.Diff.Parent}}</a>
        </dd>
      </dl>
      {{- end }}
      <pre>{{.Body}}</pre>
      {{- end }}

      {{- with .Data.Object}}
      <table>
      <tr>
        <td>
          <pre>
          {{- $l := (printf "%d" (len .Lines)) -}}
          {{- range .Lines -}}
            <a href="#L{{.}}" id="L{{.}}">{{printf "%*d" (len $l) .}}</a><br>
          {{- end -}}
          </pre>
        </td>
        <td><pre>{{.Body}}</pre></td>
      </tr>
      <table>
      {{- end }}
      <hr>
    </main>
    <footer>
      <p>Made with <a href="https://github.com/thewhodidthis/gtx">gtx</a> &rsaquo;</p>
    </footer>
  </body>
</html>