A vibe coded tangled fork which supports pijul.
at 54b89d3fa7004f6ff1cc8a471d09598675924af8 156 lines 7.7 kB view raw
1{{ define "title" }}{{ .Path }} at {{ .Ref }} &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "extrameta" }} 4 {{ template "repo/fragments/meta" . }} 5 6 {{ $title := printf "%s at %s &middot; %s" .Path .Ref .RepoInfo.FullName }} 7 {{ $url := printf "https://tangled.org/%s/blob/%s/%s" .RepoInfo.FullName .Ref .Path }} 8 9 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 10 11{{ end }} 12 13{{ define "repoContent" }} 14 {{ $linkstyle := "no-underline hover:underline" }} 15 16 {{ if .LastCommitInfo }} 17 <div class="pb-3 mb-3 border-b border-gray-200 dark:border-gray-700"> 18 <div id="commit-message"> 19 {{ $messageParts := splitN .LastCommitInfo.Message "\n\n" 2 }} 20 <div class="text-base"> 21 <a href="/{{ .RepoInfo.FullName }}/commit/{{ .LastCommitInfo.Hash }}" 22 class="inline no-underline hover:underline dark:text-white"> 23 {{ index $messageParts 0 }} 24 </a> 25 {{ if gt (len $messageParts) 1 }} 26 <button 27 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600" 28 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"> 29 {{ i "ellipsis" "w-3 h-3" }} 30 </button> 31 {{ end }} 32 </div> 33 {{ if gt (len $messageParts) 1 }} 34 <p class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"> 35 {{ nl2br (index $messageParts 1) }} 36 </p> 37 {{ end }} 38 </div> 39 <div class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center flex-wrap"> 40 {{ if .LastCommit.Author }} 41 {{ $authorDid := index .EmailToDid .LastCommit.Author.Email }} 42 <span class="flex items-center gap-1"> 43 {{ if $authorDid }} 44 {{ template "user/fragments/picHandleLink" $authorDid }} 45 {{ else }} 46 {{ placeholderAvatar "tiny" }} 47 <a href="mailto:{{ .LastCommit.Author.Email }}" class="no-underline hover:underline">{{ .LastCommit.Author.Name }}</a> 48 {{ end }} 49 </span> 50 <span class="px-1 select-none before:content-['\00B7']"></span> 51 {{ end }} 52 {{ template "repo/fragments/time" .LastCommitInfo.When }} 53 <span class="px-1 select-none before:content-['\00B7']"></span> 54 <span class="font-mono"> 55 <a href="/{{ .RepoInfo.FullName }}/commit/{{ .LastCommitInfo.Hash.String }}" 56 class="no-underline hover:underline text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900 px-2 py-1 rounded"> 57 {{ slice .LastCommitInfo.Hash.String 0 8 }} 58 </a> 59 </span> 60 </div> 61 </div> 62 {{ end }} 63 64 <div class="pb-2 mb-3 text-base border-b border-gray-200 dark:border-gray-700"> 65 <div class="flex flex-col md:flex-row md:justify-between gap-2"> 66 <div id="breadcrumbs" class="overflow-x-auto whitespace-nowrap text-gray-400 dark:text-gray-500"> 67 {{ range $idx, $value := .BreadCrumbs }} 68 {{ if ne $idx (sub (len $.BreadCrumbs) 1) }} 69 <a 70 href="{{ index . 1 }}" 71 class="text-bold text-gray-500 dark:text-gray-400 {{ $linkstyle }}" 72 >{{ pathUnescape (index . 0) }}</a 73 > 74 / 75 {{ else }} 76 <span class="text-bold text-black dark:text-white" 77 >{{ pathUnescape (index . 0) }}</span 78 > 79 {{ end }} 80 {{ end }} 81 </div> 82 <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"> 83 <span>at <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Ref }}">{{ .Ref }}</a></span> 84 85 {{ if .BlobView.ShowingText }} 86 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 87 <span>{{ .BlobView.Lines }} lines</span> 88 {{ end }} 89 90 {{ if .BlobView.SizeHint }} 91 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 92 <span>{{ byteFmt .BlobView.SizeHint }}</span> 93 {{ end }} 94 95 {{ if .BlobView.HasRawView }} 96 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 97 <a href="/{{ .RepoInfo.FullName }}/raw/{{ .Ref }}/{{ .Path }}">view raw</a> 98 {{ end }} 99 100 {{ if .BlobView.ShowToggle }} 101 <span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span> 102 <a href="/{{ .RepoInfo.FullName }}/blob/{{ .Ref }}/{{ .Path }}?code={{ .BlobView.ShowingRendered }}" hx-boost="true"> 103 view {{ if .BlobView.ShowingRendered }}code{{ else }}rendered{{ end }} 104 </a> 105 {{ end }} 106 </div> 107 </div> 108 </div> 109 {{ if .BlobView.IsUnsupported }} 110 <p class="text-center text-gray-400 dark:text-gray-500"> 111 Previews are not supported for this file type. 112 </p> 113 {{ else if .BlobView.ContentType.IsSubmodule }} 114 <p class="text-center text-gray-400 dark:text-gray-500"> 115 This directory is a git submodule of <a href="{{ .BlobView.ContentSrc }}">{{ .BlobView.ContentSrc }}</a>. 116 </p> 117 {{ else if .BlobView.ContentType.IsImage }} 118 <div class="text-center"> 119 <img src="{{ .BlobView.ContentSrc }}" 120 alt="{{ .Path }}" 121 class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded" /> 122 </div> 123 {{ else if .BlobView.ContentType.IsVideo }} 124 <div class="text-center"> 125 <video controls class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded"> 126 <source src="{{ .BlobView.ContentSrc }}"> 127 Your browser does not support the video tag. 128 </video> 129 </div> 130 {{ else if .BlobView.ContentType.IsSvg }} 131 <div class="overflow-auto relative"> 132 {{ if .BlobView.ShowingRendered }} 133 <div class="text-center"> 134 <img src="{{ .BlobView.ContentSrc }}" 135 alt="{{ .Path }}" 136 class="max-w-full h-auto mx-auto border border-gray-200 dark:border-gray-700 rounded" /> 137 </div> 138 {{ else }} 139 <div id="blob-contents" class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">{{ code .BlobView.Contents .Path | escapeHtml }}</div> 140 {{ end }} 141 </div> 142 {{ else if .BlobView.ContentType.IsMarkup }} 143 <div class="overflow-auto relative"> 144 {{ if .BlobView.ShowingRendered }} 145 <div id="blob-contents" class="prose dark:prose-invert">{{ .BlobView.Contents | readme }}</div> 146 {{ else }} 147 <div id="blob-contents" class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">{{ code .BlobView.Contents .Path | escapeHtml }}</div> 148 {{ end }} 149 </div> 150 {{ else if .BlobView.ContentType.IsCode }} 151 <div class="overflow-auto relative"> 152 <div id="blob-contents" class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">{{ code .BlobView.Contents .Path | escapeHtml }}</div> 153 </div> 154 {{ end }} 155 {{ template "fragments/multiline-select" }} 156{{ end }}