~gitpocket/gitpocket

gitpocket/templates/repo.html -rw-r--r--1.5 KiB ViewLogBlameView rawPermalink d622d6a952 — feat(basin): minimal git host with ssh and smart https 4 days ago
 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
{{define "content"}}
{{$p := .Data.Page}}
{{if $p.Repo.Description}}<p class="lede">{{$p.Repo.Description}}</p>{{end}}
<dl class="clone">
<dt>clone</dt>
<dd><code>git clone https://{{.Host}}/{{$p.Repo.Path}}</code></dd>
{{if $p.Owner}}<dd><code>git clone git@{{.Host}}:{{$p.Repo.Path}}</code></dd>{{end}}
</dl>
{{if $p.Empty}}
<p class="muted">this repository is empty. push something:</p>
<pre>git remote add origin git@{{.Host}}:{{$p.Repo.Path}}
git push -u origin {{$p.Ref}}</pre>
{{else}}
<div class="columns">
<section>
<h2><a href="/{{$p.Repo.Path}}/log/{{$p.Ref}}">latest commits</a></h2>
{{template "commits" (index .Data "Commits")}}
</section>
<section>
<h2><a href="/{{$p.Repo.Path}}/refs">refs</a></h2>
<ul class="refs">
{{range $i, $b := .Data.Branches}}{{if lt $i 6}}<li><a href="/{{$p.Repo.Path}}/tree/{{$b.Name}}/">{{$b.Name}}</a><span class="when">{{ago $b.Time}}</span></li>{{end}}{{end}}
{{range $i, $t := .Data.Tags}}{{if lt $i 6}}<li><a href="/{{$p.Repo.Path}}/tree/{{$t.Name}}/">{{$t.Name}}</a><span class="when">{{ago $t.Time}}</span></li>{{end}}{{end}}
</ul>
</section>
</div>
{{with .Data.Readme}}<article class="readme">{{.}}</article>{{end}}
{{with .Data.ReadmeText}}<article class="readme"><pre>{{.}}</pre></article>{{end}}
{{end}}
{{end}}
{{define "commits"}}
<ul class="commits">{{$path := ""}}{{range .}}<li><a class="hash" href="commit/{{.Hash}}">{{short .Hash}}</a><span class="subject">{{.Subject}}</span><span class="who">{{.Author}}</span><span class="when">{{ago .Time}}</span></li>{{end}}</ul>
{{end}}