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