forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }}{{ .Path }} at {{ .Ref }} &middot; {{ .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 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 class="pb-2 mb-3 text-base border-b border-gray-200 dark:border-gray-700"> 21 <div class="flex flex-col md:flex-row md:justify-between gap-2"> 22 <div id="breadcrumbs" class="overflow-x-auto whitespace-nowrap text-gray-400 dark:text-gray-500"> 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 dark:text-gray-400 {{ $linkstyle }}" 28 >{{ index . 0 }}</a 29 > 30 / 31 {{ else }} 32 <span class="text-bold text-gray-600 dark:text-gray-300" 33 >{{ index . 0 }}</span 34 > 35 {{ end }} 36 {{ end }} 37 </div> 38 <div id="file-info" class="text-gray-500 dark:text-gray-400 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0"> 39 <span>at <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Ref }}">{{ .Ref }}</a></span> 40 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 41 <span>{{ .Lines }} lines</span> 42 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 43 <span>{{ byteFmt .SizeHint }}</span> 44 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 45 <a href="/{{ .RepoInfo.FullName }}/blob/{{ .Ref }}/raw/{{ .Path }}">view raw</a> 46 </div> 47 </div> 48 </div> 49 {{ if .IsBinary }} 50 <p class="text-center text-gray-400 dark:text-gray-500"> 51 This is a binary file and will not be displayed. 52 </p> 53 {{ else }} 54 <div class="overflow-auto relative"> 55 <div class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">{{ $.Contents | escapeHtml }}</div> 56 </div> 57 {{ end }} 58{{ end }}