This repository has no description
1{{ define "timeline/fragments/trending" }}
2 <div class="border border border-gray-200 dark:border-gray-700 rounded-sm divide-y divide-gray-200 dark:divide-gray-700">
3 <h3 class="text-base dark:text-white flex items-center gap-2 px-4 py-2 bg-white/50 dark:bg-gray-800/50">
4 {{ i "trending-up" "size-4 flex-shrink-0" }}
5 Trending
6 </h3>
7 {{ if .Repos }}
8 <table class="w-full py-1 bg-white dark:bg-gray-800">
9 <tbody>
10 {{ range $index, $repo := .Repos }}
11 {{ template "singleLineRepo" (list $ $repo) }}
12 {{ end }}
13 </tbody>
14 </table>
15 {{ else }}
16 <div class="p-6 text-sm text-gray-500 dark:text-gray-400 text-center">
17 No trending repositories this week
18 </div>
19 {{ end }}
20 </div>
21{{ end }}
22
23{{ define "singleLineRepo" }}
24 {{ $root := index . 0 }}
25 {{ $repo := index . 1 }}
26 {{ with $repo }}
27 {{ $repoOwner := resolve .Did }}
28 <tr class="relative hover:bg-gray-100/50 dark:hover:bg-gray-700/50 group">
29 <td class="pl-4 pr-2 py-3 text-right text-gray-400 tabular-nums whitespace-nowrap align-top">
30 <div class="flex text-sm items-center justify-end gap-1">
31 {{ i "star" "w-3 h-3 fill-current shrink-0" }}
32 {{ if .RepoStats }}
33 <span>{{ scaleFmt .RepoStats.StarCount }}</span>
34 {{ else }}
35 <span>0</span>
36 {{ end }}
37 </div>
38 </td>
39 <td class="px-2 py-3 w-full max-w-0">
40 <a href="/{{ $repoOwner }}/{{ .Slug }}" class="absolute inset-0 no-underline" aria-label="{{ $repoOwner }}/{{ .Name }}"></a>
41 <span class="text-sm font-medium dark:text-white truncate block">{{ $repoOwner }}/{{ .Name }}</span>
42 {{ with .Description }}
43 <span class="text-sm text-gray-500 dark:text-gray-400 truncate line-clamp-1 block">{{ . | description }}</span>
44 {{ end }}
45 </td>
46 <td class="pl-2 pr-4 py-3 text-gray-400 text-sm whitespace-nowrap font-mono align-top">
47 {{ if and .RepoStats .RepoStats.Language }}
48 {{ $lang := .RepoStats.Language }}
49 {{ $display := $lang }}
50 {{ if gt (len $lang) 6 }}
51 {{ $display = .RepoStats.LangShortName }}
52 {{ end }}
53 <div class="flex items-center gap-1.5">
54 {{ template "repo/fragments/colorBall" (dict "color" (langColor $lang)) }}
55 <span>{{ $display }}</span>
56 </div>
57 {{ end }}
58 </td>
59 </tr>
60 {{ end }}
61{{ end }}
62