87 lines
2.4 kB
1
{{define "repoContent"}}
2
3
<main>
4
{{- if .IsEmpty }}
5
this repo is empty
6
{{ else }}
7
<div class="flex gap-4">
8
<div id="file-tree" class="w-1/2">
9
{{ $containerstyle := "py-1" }}
10
{{ $linkstyle := "no-underline hover:underline" }}
11
12
{{ range .Files }}
13
{{ if not .IsFile }}
14
<div class="{{ $containerstyle }}">
15
<a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">
16
<div class="flex items-center gap-2">
17
<i class="w-3 h-3 fill-current" data-lucide="folder"></i>{{ .Name }}/
18
</div>
19
</a>
20
</div>
21
{{ end }}
22
{{ end }}
23
24
{{ range .Files }}
25
{{ if .IsFile }}
26
<div class="{{ $containerstyle }}">
27
<a href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}" class="{{ $linkstyle }}">
28
<div class="flex items-center gap-2">
29
<i class="w-3 h-3" data-lucide="file"></i>{{ .Name }}
30
</div>
31
</a>
32
</div>
33
{{ end }}
34
{{ end }}
35
</div>
36
<div id="commit-log" class="flex-1">
37
{{ range .Commits }}
38
<div class=
39
"relative
40
px-4
41
py-4
42
border-l
43
border-black
44
before:content-['']
45
before:absolute
46
before:w-1
47
before:h-1
48
before:bg-black
49
before:rounded-full
50
before:left-[-2.2px]
51
before:top-1/2
52
before:-translate-y-1/2
53
">
54
<div class="text-base">{{ .Message }}</div>
55
56
<div class="text-xs text-gray-500">
57
<span class="font-mono">
58
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="text-gray-500 no-underline hover:underline">{{ slice .Hash.String 0 8 }}</a>
59
</span>
60
·
61
<span>
62
<a href="mailto:{{ .Author.Email }}" class="text-gray-500 no-underline hover:underline">{{ .Author.Name }}</a>
63
</span>
64
·
65
<span>{{ timeFmt .Author.When }}</span>
66
</div>
67
68
</div>
69
{{ end }}
70
</div>
71
</div>
72
{{- if .Readme }}
73
<article class="readme">
74
{{- .Readme -}}
75
</article>
76
{{- end -}}
77
{{- end -}}
78
79
<div class="clone-url">
80
<strong>clone</strong>
81
<pre>
82
git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}
83
</pre>
84
</div>
85
</main>
86
{{end}}
87
88