1{{ define "title" }}{{ .Path }} at {{ .Ref }} · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "repoContent" }}
4 {{ $lines := split .Contents }}
5 {{ $tot_lines := len $lines }}
6 {{ $tot_chars := len (printf "%d" $tot_lines) }}
7 {{ $code_number_style := "text-gray-400 left-0 bg-white text-right mr-6 select-none" }}
8 {{ $linkstyle := "no-underline hover:underline" }}
9 <div class="pb-2 text-base">
10 <div class="flex justify-between">
11 <div id="breadcrumbs">
12 {{ range $idx, $value := .BreadCrumbs }}
13 {{ if ne $idx (sub (len $.BreadCrumbs) 1) }}
14 <a
15 href="{{ index . 1 }}"
16 class="text-bold text-gray-500 {{ $linkstyle }}"
17 >{{ index . 0 }}</a
18 >
19 /
20 {{ else }}
21 <span class="text-bold text-gray-500"
22 >{{ index . 0 }}</span
23 >
24 {{ end }}
25 {{ end }}
26 </div>
27 <div id="file-info" class="text-gray-500 text-xs">
28 {{ .Lines }} lines
29 <span class="select-none px-2 [&:before]:content-['·']"></span>
30 {{ byteFmt .SizeHint }}
31 </div>
32 </div>
33 </div>
34 {{ if .IsBinary }}
35 <p class="text-center text-gray-400">
36 This is a binary file and will not be displayed.
37 </p>
38 {{ else }}
39 <div class="overflow-auto relative text-ellipsis">
40 {{ range $idx, $line := $lines }}
41 {{ $linenr := add $idx 1 }}
42 <div class="flex">
43 <a href="#L{{ $linenr }}" id="L{{ $linenr }}" class="no-underline peer">
44 <span class="{{ $code_number_style }}"
45 style="min-width: {{ $tot_chars }}ch;" >
46 {{ $linenr }}
47 </span>
48 </a>
49 <div class="whitespace-pre peer-target:bg-yellow-200">{{ $line | escapeHtml }}</div>
50 </div>
51 {{ end }}
52 </div>
53 {{ end }}
54{{ end }}