52 lines
2.1 kB
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
<div class="flex">
42
<span
43
class="{{ $code_number_style }}"
44
style="min-width: {{ $tot_chars }}ch;"
45
>{{ add $idx 1 }}</span
46
>
47
<div class="whitespace-pre">{{ $line | escapeHtml }}</div>
48
</div>
49
{{ end }}
50
</div>
51
{{ end }}
52
{{ end }}
53