this repo has no description
1{{ define "title" }}
2 {{ .Path }} at {{ .Ref }} · {{ .RepoInfo.FullName }}
3{{ end }}
4
5{{ define "extrameta" }}
6 {{ template "repo/fragments/meta" . }}
7
8 {{ $title := printf "%s at %s · %s" .Path .Ref .RepoInfo.FullName }}
9 {{ $url := printf "https://tangled.sh/%s/blob/%s/%s" .RepoInfo.FullName .Ref .Path }}
10
11 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
12{{ end }}
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 dark:text-gray-500 left-0 bg-white dark:bg-gray-800 text-right mr-6 select-none inline-block w-12" }}
19 {{ $linkstyle := "no-underline hover:underline" }}
20 <div
21 class="pb-2 mb-3 text-base border-b border-gray-200 dark:border-gray-700">
22 <div class="flex flex-col md:flex-row md:justify-between gap-2">
23 <div
24 id="breadcrumbs"
25 class="overflow-x-auto whitespace-nowrap text-gray-400 dark:text-gray-500">
26 {{ range $idx, $value := .BreadCrumbs }}
27 {{ if ne $idx (sub (len $.BreadCrumbs) 1) }}
28 <a
29 href="{{ index . 1 }}"
30 class="text-bold text-gray-500 dark:text-gray-400 {{ $linkstyle }}">
31 {{ pathUnescape (index . 0) }}
32 </a>
33 /
34 {{ else }}
35 <span class="text-bold text-black dark:text-white">
36 {{ pathUnescape (index . 0) }}
37 </span>
38 {{ end }}
39 {{ end }}
40 </div>
41 <div
42 id="file-info"
43 class="text-gray-500 dark:text-gray-400 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0">
44 <span>
45 at
46 <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Ref }}">{{ .Ref }}</a>
47 </span>
48 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span>
49 <span>{{ .Lines }} lines</span>
50 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span>
51 <span>{{ byteFmt .SizeHint }}</span>
52 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span>
53 <a href="/{{ .RepoInfo.FullName }}/raw/{{ .Ref }}/{{ .Path }}">
54 view raw
55 </a>
56 {{ if .RenderToggle }}
57 <span
58 class="select-none px-1 md:px-2 [&:before]:content-['·']"></span>
59 <a
60 href="/{{ .RepoInfo.FullName }}/blob/{{ .Ref }}/{{ .Path }}?code={{ .ShowRendered }}"
61 hx-boost="true">
62 view {{ if .ShowRendered }}code{{ else }}rendered{{ end }}
63 </a>
64 {{ end }}
65 </div>
66 </div>
67 </div>
68 {{ if and .IsBinary .Unsupported }}
69 <p class="text-center text-gray-400 dark:text-gray-500">
70 Previews are not supported for this file type.
71 </p>
72 {{ else if .IsBinary }}
73 <div class="text-center">
74 {{ if .IsImage }}
75 <img
76 src="{{ .ContentSrc }}"
77 alt="{{ .Path }}"
78 class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded" />
79 {{ else if .IsVideo }}
80 <video
81 controls
82 class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded">
83 <source src="{{ .ContentSrc }}" />
84 Your browser does not support the video tag.
85 </video>
86 {{ end }}
87 </div>
88 {{ else }}
89 <div class="overflow-auto relative">
90 {{ if .ShowRendered }}
91 <div id="blob-contents" class="prose dark:prose-invert">
92 {{ .RenderedContents }}
93 </div>
94 {{ else }}
95 <div
96 id="blob-contents"
97 class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">
98 {{ $.Contents | escapeHtml }}
99 </div>
100 {{ end }}
101 </div>
102 {{ end }}
103{{ end }}