this repo has no description
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }}
2
3
4{{ define "extrameta" }}
5 {{ template "repo/fragments/meta" . }}
6
7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo) }}
8
9 <!-- Structured Data for Repository -->
10 <script type="application/ld+json">
11 {
12 "@context": "https://schema.org",
13 "@type": "SoftwareSourceCode",
14 "name": "{{ .RepoInfo.Name }}",
15 "description": "{{ .RepoInfo.Description }}",
16 "codeRepository": "https://tangled.org/{{ .RepoInfo.FullName }}",
17 "programmingLanguage": {{ if .Languages }}{{ range $idx, $lang := .Languages }}{{ if eq $idx 0 }}"{{ $lang.Name }}"{{ end }}{{ end }}{{ else }}"Unknown"{{ end }},
18 "url": "https://tangled.org/{{ .RepoInfo.FullName }}",
19 "author": {
20 "@type": "Person",
21 "name": "{{ .RepoInfo.OwnerWithAt }}",
22 "url": "https://tangled.org/{{ .RepoInfo.OwnerWithAt }}"
23 }{{ if .RepoInfo.Source }},
24 "isBasedOn": {
25 "@type": "SoftwareSourceCode",
26 "name": "{{ .RepoInfo.Source.Name }}",
27 "url": "https://tangled.org/{{ didOrHandle .RepoInfo.Source.Did .RepoInfo.SourceHandle }}/{{ .RepoInfo.Source.Name }}"
28 }{{ end }}
29 }
30 </script>
31
32 <!-- Breadcrumb Navigation -->
33 {{ template "fragments/breadcrumb" (list
34 (list "Home" "https://tangled.org")
35 (list .RepoInfo.OwnerWithAt (printf "https://tangled.org/%s" .RepoInfo.OwnerWithAt))
36 (list .RepoInfo.Name (printf "https://tangled.org/%s" .RepoInfo.FullName))
37 ) }}
38{{ end }}
39
40{{ define "canonical" }}https://tangled.org/{{ .RepoInfo.FullName }}{{ end }}
41
42{{ define "rss" }}
43 <link rel="alternate" type="application/atom+xml" title="{{ .RepoInfo.FullName }} Activity Feed" href="https://tangled.org/{{ .RepoInfo.FullName }}/feed.atom" />
44{{ end }}
45
46{{ define "repoContent" }}
47 <main>
48 {{ if .Languages }}
49 {{ block "repoLanguages" . }}{{ end }}
50 {{ end }}
51 <div class="flex items-center justify-between pb-5">
52 {{ block "branchSelector" . }}{{ end }}
53 <div class="flex md:hidden items-center gap-2">
54 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1 font-bold">
55 {{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }}
56 </a>
57 <a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1 font-bold">
58 {{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }}
59 </a>
60 <a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1 font-bold">
61 {{ i "tags" "w-4" "h-4" }} {{ len .Tags }}
62 </a>
63 {{ template "repo/fragments/cloneDropdown" . }}
64 </div>
65 </div>
66 <div class="grid grid-cols-1 md:grid-cols-2 gap-2">
67 {{ block "fileTree" . }}{{ end }}
68 {{ block "rightInfo" . }}{{ end }}
69 </div>
70 </main>
71{{ end }}
72
73{{ define "repoLanguages" }}
74 <details class="group -my-4 -m-6 mb-4">
75 <summary class="flex gap-[1px] h-4 scale-y-50 hover:scale-y-100 origin-top group-open:scale-y-100 transition-all hover:cursor-pointer overflow-hidden rounded-t">
76 {{ range $value := .Languages }}
77 <div
78 title='{{ or $value.Name "Other" }} {{ printf "%.1f" $value.Percentage }}%'
79 style="background-color: {{ $value.Color }}; width: {{ $value.Percentage }}%"
80 ></div>
81 {{ end }}
82 </summary>
83 <div class="px-4 py-2 border-b border-gray-200 dark:border-gray-600 flex items-center gap-4 flex-wrap">
84 {{ range $value := .Languages }}
85 <div
86 class="flex items-center gap-2 text-xs align-items-center justify-center"
87 >
88 {{ template "repo/fragments/colorBall" (dict "color" (langColor $value.Name)) }}
89 <div>{{ or $value.Name "Other" }}
90 <span class="text-gray-500 dark:text-gray-400">
91 {{ if lt $value.Percentage 0.05 }}
92 0.1%
93 {{ else }}
94 {{ printf "%.1f" $value.Percentage }}%
95 {{ end }}
96 </span></div>
97 </div>
98 {{ end }}
99 </div>
100 </details>
101{{ end }}
102
103{{ define "branchSelector" }}
104 <div class="flex gap-2 items-center justify-between w-full">
105 <div class="flex gap-2 items-center">
106 <select
107 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
108 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
109 >
110 <optgroup label="branches ({{len .Branches}})" class="bold text-sm">
111 {{ range .Branches }}
112 <option
113 value="{{ .Reference.Name }}"
114 class="py-1"
115 {{ if eq .Reference.Name $.Ref }}
116 selected
117 {{ end }}
118 >
119 {{ .Reference.Name }}
120 </option>
121 {{ end }}
122 </optgroup>
123 <optgroup label="tags ({{len .Tags}})" class="bold text-sm">
124 {{ range .Tags }}
125 <option
126 value="{{ .Reference.Name }}"
127 class="py-1"
128 {{ if eq .Reference.Name $.Ref }}
129 selected
130 {{ end }}
131 >
132 {{ .Reference.Name }}
133 </option>
134 {{ else }}
135 <option class="py-1" disabled>no tags found</option>
136 {{ end }}
137 </optgroup>
138 </select>
139 <div class="flex items-center gap-2">
140 <a
141 href="/{{ .RepoInfo.FullName }}/compare?base={{ $.Ref | urlquery }}"
142 class="btn flex items-center gap-2 no-underline hover:no-underline"
143 title="Compare branches or tags"
144 >
145 {{ i "git-compare" "w-4 h-4" }}
146 </a>
147 </div>
148 </div>
149
150 <!-- Clone dropdown in top right -->
151 <div class="hidden md:flex items-center ">
152 {{ template "repo/fragments/cloneDropdown" . }}
153 </div>
154 </div>
155{{ end }}
156
157{{ define "fileTree" }}
158 <div id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700" >
159 {{ $linkstyle := "no-underline hover:underline dark:text-white" }}
160
161 {{ range .Files }}
162 <div class="grid grid-cols-3 gap-4 items-center py-1">
163 <div class="col-span-2">
164 {{ $link := printf "/%s/%s/%s/%s" $.RepoInfo.FullName "tree" (urlquery $.Ref) .Name }}
165 {{ $icon := "folder" }}
166 {{ $iconStyle := "size-4 fill-current" }}
167
168 {{ if .IsSubmodule }}
169 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }}
170 {{ $icon = "folder-input" }}
171 {{ $iconStyle = "size-4" }}
172 {{ end }}
173
174 {{ if .IsFile }}
175 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }}
176 {{ $icon = "file" }}
177 {{ $iconStyle = "size-4" }}
178 {{ end }}
179
180 <a href="{{ $link }}" class="{{ $linkstyle }}">
181 <div class="flex items-center gap-2">
182 {{ i $icon $iconStyle "flex-shrink-0" }}
183 <span class="truncate">{{ .Name }}</span>
184 </div>
185 </a>
186 </div>
187
188 <div class="text-sm col-span-1 text-right">
189 {{ with .LastCommit }}
190 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash }}" class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .When }}</a>
191 {{ end }}
192 </div>
193 </div>
194 {{ end }}
195 </div>
196{{ end }}
197
198{{ define "rightInfo" }}
199 <div id="right-info" class="hidden md:block col-span-1">
200 {{ block "commitLog" . }} {{ end }}
201 {{ block "branchList" . }} {{ end }}
202 {{ block "tagList" . }} {{ end }}
203 </div>
204{{ end }}
205
206{{ define "commitLog" }}
207<div id="commit-log" class="md:col-span-1 px-2 pb-4">
208 <div class="flex justify-between items-center">
209 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
210 {{ i "logs" "w-4 h-4" }} commits
211 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ .TotalCommits }}</span>
212 </a>
213 </div>
214 <div class="flex flex-col gap-6">
215 {{ range .CommitsTrunc }}
216 <div>
217 <div id="commit-message">
218 {{ $messageParts := splitN .Message "\n\n" 2 }}
219 <div class="text-base cursor-pointer">
220 <div>
221 <div>
222 <a
223 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
224 class="inline no-underline hover:underline dark:text-white"
225 >{{ index $messageParts 0 }}</a
226 >
227 {{ if gt (len $messageParts) 1 }}
228
229 <button
230 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
231 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
232 >
233 {{ i "ellipsis" "w-3 h-3" }}
234 </button>
235 {{ end }}
236 </div>
237 {{ if gt (len $messageParts) 1 }}
238 <p
239 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
240 >
241 {{ nl2br (index $messageParts 1) }}
242 </p>
243 {{ end }}
244 </div>
245 </div>
246 </div>
247
248 <!-- commit info bar -->
249 <div class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center flex-wrap">
250 {{ $verified := $.VerifiedCommits.IsVerified .Hash.String }}
251 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }}
252 {{ if $verified }}
253 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }}
254 {{ end }}
255 <span class="font-mono">
256 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
257 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2">
258 {{ slice .Hash.String 0 8 }}
259 {{ if $verified }}
260 {{ i "shield-check" "w-3 h-3" }}
261 {{ end }}
262 </a>
263 </span>
264 <span
265 class="mx-1 before:content-['·'] before:select-none"
266 ></span>
267 <span>
268 {{ $did := index $.EmailToDid .Author.Email }}
269 <a href="{{ if $did }}/{{ resolve $did }}{{ else }}mailto:{{ .Author.Email }}{{ end }}"
270 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
271 >{{ if $did }}{{ template "user/fragments/picHandleLink" $did }}{{ else }}{{ .Author.Name }}{{ end }}</a>
272 </span>
273 <div class="inline-block px-1 select-none after:content-['·']"></div>
274 {{ template "repo/fragments/time" .Committer.When }}
275
276 <!-- tags/branches -->
277 {{ $tagsForCommit := index $.TagMap .Hash.String }}
278 {{ if gt (len $tagsForCommit) 0 }}
279 <div class="inline-block px-1 select-none after:content-['·']"></div>
280 {{ end }}
281 {{ range $tagsForCommit }}
282 <span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-[2px] inline-flex items-center">
283 {{ . }}
284 </span>
285 {{ end }}
286
287 <!-- ci status -->
288 {{ $pipeline := index $.Pipelines .Hash.String }}
289 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
290 <div class="inline-block px-1 select-none after:content-['·']"></div>
291 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "RepoInfo" $.RepoInfo "Pipeline" $pipeline) }}
292 {{ end }}
293 </div>
294 </div>
295 {{ end }}
296 </div>
297</div>
298{{ end }}
299
300{{ define "branchList" }}
301 {{ if gt (len .BranchesTrunc) 0 }}
302 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
303 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
304 {{ i "git-branch" "w-4 h-4" }} branches
305 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ len .Branches }}</span>
306 </a>
307 <div class="flex flex-col gap-1">
308 {{ range .BranchesTrunc }}
309 <div class="text-base flex items-center justify-between overflow-hidden">
310 <div class="flex items-center gap-2 min-w-0 flex-1">
311 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
312 class="inline-block truncate no-underline hover:underline dark:text-white">
313 {{ .Reference.Name }}
314 </a>
315 {{ if .Commit }}
316 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span>
317 <span class="whitespace-nowrap text-xs text-gray-500 dark:text-gray-400 shrink-0">{{ template "repo/fragments/time" .Commit.Committer.When }}</span>
318 {{ end }}
319 {{ if .IsDefault }}
320 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span>
321 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono shrink-0">default</span>
322 {{ end }}
323 </div>
324 {{ if ne $.Ref .Reference.Name }}
325 <a href="/{{ $.RepoInfo.FullName }}/compare/{{ $.Ref | urlquery }}...{{ .Reference.Name | urlquery }}"
326 class="text-xs flex gap-2 items-center shrink-0 ml-2"
327 title="Compare branches or tags">
328 {{ i "git-compare" "w-3 h-3" }} compare
329 </a>
330 {{ end }}
331 </div>
332 {{ end }}
333 </div>
334 </div>
335 {{ end }}
336{{ end }}
337
338{{ define "tagList" }}
339 {{ if gt (len .TagsTrunc) 0 }}
340 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
341 <div class="flex justify-between items-center">
342 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
343 {{ i "tags" "w-4 h-4" }} tags
344 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ len .Tags }}</span>
345 </a>
346 </div>
347 <div class="flex flex-col gap-1">
348 {{ range $idx, $tag := .TagsTrunc }}
349 {{ with $tag }}
350 <div>
351 <div class="text-base flex items-center gap-2">
352 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
353 class="inline no-underline hover:underline dark:text-white">
354 {{ .Reference.Name }}
355 </a>
356 </div>
357 <div>
358 {{ with .Tag }}
359 <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Tagger.When }}</span>
360 {{ end }}
361 {{ if eq $idx 0 }}
362 {{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>{{ end }}
363 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span>
364 {{ end }}
365 </div>
366 </div>
367 {{ end }}
368 {{ end }}
369 </div>
370 </div>
371 {{ end }}
372{{ end }}
373
374{{ define "repoAfter" }}
375 {{- if or .HTMLReadme .Readme -}}
376 {{ template "repo/fragments/readme" . }}
377 {{- end -}}
378{{ end }}