this repo has no description
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }}
2
3{{ define "extrameta" }}
4 <meta
5 name="vcs:clone"
6 content="https://tangled.sh/{{ .RepoInfo.FullName }}"
7 />
8 <meta
9 name="forge:summary"
10 content="https://tangled.sh/{{ .RepoInfo.FullName }}"
11 />
12 <meta
13 name="forge:dir"
14 content="https://tangled.sh/{{ .RepoInfo.FullName }}/tree/{ref}/{path}"
15 />
16 <meta
17 name="forge:file"
18 content="https://tangled.sh/{{ .RepoInfo.FullName }}/blob/{ref}/{path}"
19 />
20 <meta
21 name="forge:line"
22 content="https://tangled.sh/{{ .RepoInfo.FullName }}/blob/{ref}/{path}#L{line}"
23 />
24 <meta
25 name="go-import"
26 content="tangled.sh/{{ .RepoInfo.FullNameWithoutAt }} git https://tangled.sh/{{ .RepoInfo.FullName }}"
27 />
28{{ end }}
29
30{{ define "repoContent" }}
31 <main>
32 <div class="flex items-center justify-between pb-5">
33 {{ block "branchSelector" . }}{{ end }}
34 <div class="flex md:hidden items-center gap-4">
35 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1">
36 {{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }}
37 </a>
38 <a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1">
39 {{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }}
40 </a>
41 <a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1">
42 {{ i "tags" "w-4" "h-4" }} {{ len .Tags }}
43 </a>
44 </div>
45 </div>
46 <div class="grid grid-cols-1 md:grid-cols-2 gap-2">
47 {{ block "fileTree" . }}{{ end }}
48 {{ block "rightInfo" . }}{{ end }}
49 </div>
50 </main>
51{{ end }}
52
53{{ define "branchSelector" }}
54 <select
55 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
56 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
57 >
58 <optgroup label="branches ({{len .Branches}})" class="bold text-sm">
59 {{ range .Branches }}
60 <option
61 value="{{ .Reference.Name }}"
62 class="py-1"
63 {{ if eq .Reference.Name $.Ref }}
64 selected
65 {{ end }}
66 >
67 {{ .Reference.Name }}
68 </option>
69 {{ end }}
70 </optgroup>
71 <optgroup label="tags ({{len .Tags}})" class="bold text-sm">
72 {{ range .Tags }}
73 <option
74 value="{{ .Reference.Name }}"
75 class="py-1"
76 {{ if eq .Reference.Name $.Ref }}
77 selected
78 {{ end }}
79 >
80 {{ .Reference.Name }}
81 </option>
82 {{ else }}
83 <option class="py-1" disabled>no tags found</option>
84 {{ end }}
85 </optgroup>
86 </select>
87{{ end }}
88
89{{ define "fileTree" }}
90 <div
91 id="file-tree"
92 class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700"
93 >
94 {{ $containerstyle := "py-1" }}
95 {{ $linkstyle := "no-underline hover:underline dark:text-white" }}
96
97 {{ range .Files }}
98 {{ if not .IsFile }}
99 <div class="{{ $containerstyle }}">
100 <div class="flex justify-between items-center">
101 <a
102 href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref | urlquery }}/{{ .Name }}"
103 class="{{ $linkstyle }}"
104 >
105 <div class="flex items-center gap-2">
106 {{ i "folder" "w-3 h-3 fill-current" }}
107 {{ .Name }}
108 </div>
109 </a>
110
111 <time class="text-xs text-gray-500 dark:text-gray-400"
112 >{{ timeFmt .LastCommit.When }}</time
113 >
114 </div>
115 </div>
116 {{ end }}
117 {{ end }}
118
119 {{ range .Files }}
120 {{ if .IsFile }}
121 <div class="{{ $containerstyle }}">
122 <div class="flex justify-between items-center">
123 <a
124 href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref | urlquery }}/{{ .Name }}"
125 class="{{ $linkstyle }}"
126 >
127 <div class="flex items-center gap-2">
128 {{ i "file" "w-3 h-3" }}{{ .Name }}
129 </div>
130 </a>
131
132 <time class="text-xs text-gray-500 dark:text-gray-400"
133 >{{ timeFmt .LastCommit.When }}</time
134 >
135 </div>
136 </div>
137 {{ end }}
138 {{ end }}
139 </div>
140{{ end }}
141
142{{ define "rightInfo" }}
143 <div id="right-info" class="hidden md:block col-span-1">
144 {{ block "commitLog" . }} {{ end }}
145 {{ block "branchList" . }} {{ end }}
146 {{ block "tagList" . }} {{ end }}
147 </div>
148{{ end }}
149
150{{ define "commitLog" }}
151<div id="commit-log" class="md:col-span-1 px-2 pb-4">
152 <div class="flex justify-between items-center">
153 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
154 <div class="flex gap-2 items-center">
155 {{ i "git-commit-horizontal" "w-4 h-4" }} commits
156 </div>
157 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
158 view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }}
159 </span>
160 </a>
161 </div>
162 <div class="flex flex-col gap-6">
163 {{ range .CommitsTrunc }}
164 <div>
165 <div id="commit-message">
166 {{ $messageParts := splitN .Message "\n\n" 2 }}
167 <div class="text-base cursor-pointer">
168 <div>
169 <div>
170 <a
171 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
172 class="inline no-underline hover:underline dark:text-white"
173 >{{ index $messageParts 0 }}</a
174 >
175 {{ if gt (len $messageParts) 1 }}
176
177 <button
178 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
179 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
180 >
181 {{ i "ellipsis" "w-3 h-3" }}
182 </button>
183 {{ end }}
184 </div>
185 {{ if gt (len $messageParts) 1 }}
186 <p
187 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
188 >
189 {{ nl2br (index $messageParts 1) }}
190 </p>
191 {{ end }}
192 </div>
193 </div>
194 </div>
195
196 <div class="text-xs text-gray-500 dark:text-gray-400">
197 <span class="font-mono">
198 <a
199 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
200 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
201 >{{ slice .Hash.String 0 8 }}</a
202 ></span
203 >
204 <span
205 class="mx-2 before:content-['·'] before:select-none"
206 ></span>
207 <span>
208 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }}
209 <a
210 href="{{ if $didOrHandle }}
211 /{{ $didOrHandle }}
212 {{ else }}
213 mailto:{{ .Author.Email }}
214 {{ end }}"
215 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
216 >{{ if $didOrHandle }}
217 {{ $didOrHandle }}
218 {{ else }}
219 {{ .Author.Name }}
220 {{ end }}</a
221 >
222 </span>
223 <div
224 class="inline-block px-1 select-none after:content-['·']"
225 ></div>
226 <span>{{ timeFmt .Author.When }}</span>
227 {{ $tagsForCommit := index $.TagMap .Hash.String }}
228 {{ if gt (len $tagsForCommit) 0 }}
229 <div
230 class="inline-block px-1 select-none after:content-['·']"
231 ></div>
232 {{ end }}
233 {{ range $tagsForCommit }}
234 <span
235 class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center"
236 >
237 {{ . }}
238 </span>
239 {{ end }}
240 </div>
241 </div>
242 {{ end }}
243 </div>
244</div>
245{{ end }}
246
247{{ define "branchList" }}
248 {{ if gt (len .BranchesTrunc) 0 }}
249 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
250 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
251 <div class="flex gap-2 items-center">
252 <!-- git-branch icon is seemingly bigger than others at 4x4 -->
253 {{ i "git-branch" "w-3 h-3" }} branches
254 </div>
255 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
256 view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }}
257 </span>
258 </a>
259 <div class="flex flex-col gap-1">
260 {{ range .BranchesTrunc }}
261 <div class="text-base flex items-center gap-2">
262 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
263 class="inline no-underline hover:underline dark:text-white">
264 {{ .Reference.Name }}
265 </a>
266 {{ if .Commit }}
267 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
268 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Commit.Author.When }}</time>
269 {{ end }}
270 {{ if .IsDefault }}
271 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
272 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">default</span>
273 {{ end }}
274 </div>
275 {{ end }}
276 </div>
277 </div>
278 {{ end }}
279{{ end }}
280
281{{ define "tagList" }}
282 {{ if gt (len .TagsTrunc) 0 }}
283 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
284 <div class="flex justify-between items-center">
285 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
286 <div class="flex gap-2 items-center">
287 {{ i "tags" "w-4 h-4" }} tags
288 </div>
289 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
290 view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }}
291 </span>
292 </a>
293 </div>
294 <div class="flex flex-col gap-1">
295 {{ range $idx, $tag := .TagsTrunc }}
296 {{ with $tag }}
297 <div>
298 <div class="text-base flex items-center gap-2">
299 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
300 class="inline no-underline hover:underline dark:text-white">
301 {{ .Reference.Name }}
302 </a>
303 </div>
304 <div>
305 {{ with .Tag }}
306 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Tagger.When }}</time>
307 {{ end }}
308 {{ if eq $idx 0 }}
309 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
310 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span>
311 {{ end }}
312 </div>
313 </div>
314 {{ end }}
315 {{ end }}
316 </div>
317 </div>
318 {{ end }}
319{{ end }}
320
321{{ define "repoAfter" }}
322 {{- if .HTMLReadme }}
323 <section
324 class="p-6 mt-4 rounded-br rounded-bl bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto {{ if not .Raw }}
325 prose dark:prose-invert dark:[&_pre]:bg-gray-900
326 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900
327 dark:[&_pre]:border dark:[&_pre]:border-gray-700
328 {{ end }}"
329 >
330 <article class="{{ if .Raw }}whitespace-pre{{ end }}">
331 {{ if .Raw }}
332 <pre
333 class="dark:bg-gray-900 dark:text-gray-200 dark:border dark:border-gray-700 dark:p-4 dark:rounded"
334 >
335{{ .HTMLReadme }}</pre
336 >
337 {{ else }}
338 {{ .HTMLReadme }}
339 {{ end }}
340 </article>
341 </section>
342 {{- end -}}
343
344 {{ template "repo/fragments/cloneInstructions" . }}
345{{ end }}