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