this repo has no description
1{{ define "repoContent" }}
2<main>
3 {{- if .IsEmpty }}
4 this repo is empty
5 {{ else }}
6 <div class="flex gap-4">
7 <div id="file-tree" class="w-3/5">
8 {{ $containerstyle := "py-1" }}
9 {{ $linkstyle := "no-underline hover:underline" }}
10
11 <div class="flex justify-end">
12 <select
13 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + this.value"
14 class="p-1 border border-gray-500 bg-white"
15 >
16 <optgroup label="branches" class="bold text-sm">
17 {{ range .Branches }}
18 <option
19 value="{{ .Reference.Name }}"
20 class="py-1"
21 {{if eq .Reference.Name $.Ref}}selected{{end}}
22 >
23 {{ .Reference.Name }}
24 </option>
25 {{ end }}
26 </optgroup>
27 <optgroup label="tags" class="bold text-sm">
28 {{ range .Tags }}
29 <option
30 value="{{ .Reference.Name }}"
31 class="py-1"
32 {{if eq .Reference.Name $.Ref}}selected{{end}}
33 >
34 {{ .Reference.Name }}
35 </option>
36 {{ else }}
37 <option class="py-1" disabled>no tags found</option>
38 {{ end }}
39 </optgroup>
40 </select>
41 </div>
42
43 {{ range .Files }}
44 {{ if not .IsFile }}
45 <div class="{{ $containerstyle }}">
46 <div class="flex justify-between items-center">
47 <a
48 href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}/{{ .Name }}"
49 class="{{ $linkstyle }}"
50 >
51 <div class="flex items-center gap-2">
52 <i
53 class="w-3 h-3 fill-current"
54 data-lucide="folder"
55 ></i
56 >{{ .Name }}
57 </div>
58 </a>
59
60 <time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>
61 </div>
62 </div>
63 {{ end }}
64 {{ end }}
65
66 {{ range .Files }}
67 {{ if .IsFile }}
68 <div class="{{ $containerstyle }}">
69 <div class="flex justify-between items-center">
70 <a
71 href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref }}/{{ .Name }}"
72 class="{{ $linkstyle }}"
73 >
74 <div class="flex items-center gap-2">
75 <i
76 class="w-3 h-3"
77 data-lucide="file"
78 ></i
79 >{{ .Name }}
80 </div>
81 </a>
82
83 <time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>
84 </div>
85 </div>
86 {{ end }}
87 {{ end }}
88 </div>
89 <div id="commit-log" class="flex-1">
90 {{ range .Commits }}
91 <div
92 class="relative
93 px-4
94 py-4
95 border-l
96 border-black
97 before:content-['']
98 before:absolute
99 before:w-1
100 before:h-1
101 before:bg-black
102 before:rounded-full
103 before:left-[-2.2px]
104 before:top-1/2
105 before:-translate-y-1/2
106 ">
107
108 <div id="commit-message">
109 {{ $messageParts := splitN .Message "\n\n" 2 }}
110 <div class="text-base cursor-pointer">
111 <div>
112 <div>
113 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" class="inline no-underline hover:underline">{{ index $messageParts 0 }}</a>
114 {{ if gt (len $messageParts) 1 }}
115
116 <button class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded"
117 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">
118 <i class="w-3 h-3" data-lucide="ellipsis"></i>
119 </button>
120 {{ end }}
121 </div>
122 {{ if gt (len $messageParts) 1 }}
123 <p class="hidden mt-1 text-sm cursor-text pb-2">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>
124 {{ end }}
125 </div>
126 </div>
127 </div>
128
129 <div class="text-xs text-gray-500">
130 <span class="font-mono">
131 <a
132 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
133 class="text-gray-500 no-underline hover:underline"
134 >{{ slice .Hash.String 0 8 }}</a
135 >
136 </span>
137 <span class="mx-2 before:content-['·'] before:select-none"></span>
138 <span>
139 <a
140 href="mailto:{{ .Author.Email }}"
141 class="text-gray-500 no-underline hover:underline"
142 >{{ .Author.Name }}</a
143 >
144 </span>
145 <div class="inline-block px-1 select-none after:content-['·']"></div>
146 <span>{{ timeFmt .Author.When }}</span>
147 </div>
148 </div>
149 {{ end }}
150 </div>
151 </div>
152 {{- end -}}
153
154</main>
155{{ end }}
156
157{{ define "repoAfter" }}
158{{- if .Readme }}
159<section class="mt-4 p-6 border border-black w-full mx-auto">
160 <article class="readme">
161 {{- .Readme -}}
162 </article>
163</section>
164{{- end -}}
165
166<section class="mt-4 p-6 border border-black w-full mx-auto">
167 <strong>clone</strong>
168 <pre> git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }} </pre>
169</section>
170{{ end }}