A vibe coded tangled fork which supports pijul.
at 8fb22cb34756cc2930bb780548d45bde56cdbe65 399 lines 16 kB view raw
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }} 2 3 4{{ define "extrameta" }} 5 {{ template "repo/fragments/meta" . }} 6 7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo) }} 8 9 <!-- Structured Data for Repository --> 10 <script type="application/ld+json"> 11 { 12 "@context": "https://schema.org", 13 "@type": "SoftwareSourceCode", 14 "name": "{{ .RepoInfo.Name }}", 15 "description": "{{ .RepoInfo.Description }}", 16 "codeRepository": "https://tangled.org/{{ .RepoInfo.FullName }}", 17 "programmingLanguage": {{ if .Languages }}{{ range $idx, $lang := .Languages }}{{ if eq $idx 0 }}"{{ $lang.Name }}"{{ end }}{{ end }}{{ else }}"Unknown"{{ end }}, 18 "url": "https://tangled.org/{{ .RepoInfo.FullName }}", 19 "author": { 20 "@type": "Person", 21 "name": "{{ .RepoInfo.OwnerWithAt }}", 22 "url": "https://tangled.org/{{ .RepoInfo.OwnerWithAt }}" 23 }{{ if .RepoInfo.Source }}, 24 "isBasedOn": { 25 "@type": "SoftwareSourceCode", 26 "name": "{{ .RepoInfo.Source.Name }}", 27 "url": "https://tangled.org/{{ didOrHandle .RepoInfo.Source.Did .RepoInfo.SourceHandle }}/{{ .RepoInfo.Source.Name }}" 28 }{{ end }} 29 } 30 </script> 31 32 <!-- Breadcrumb Navigation --> 33 {{ template "fragments/breadcrumb" (list 34 (list "Home" "https://tangled.org") 35 (list .RepoInfo.OwnerWithAt (printf "https://tangled.org/%s" .RepoInfo.OwnerWithAt)) 36 (list .RepoInfo.Name (printf "https://tangled.org/%s" .RepoInfo.FullName)) 37 ) }} 38{{ end }} 39 40{{ define "canonical" }}https://tangled.org/{{ .RepoInfo.FullName }}{{ end }} 41 42{{ define "rss" }} 43 <link rel="alternate" type="application/atom+xml" title="{{ .RepoInfo.FullName }} Activity Feed" href="https://tangled.org/{{ .RepoInfo.FullName }}/feed.atom" /> 44{{ end }} 45 46{{ define "repoContent" }} 47 <main> 48 {{ if .Languages }} 49 {{ block "repoLanguages" . }}{{ end }} 50 {{ end }} 51 <div class="flex items-center justify-between pb-5"> 52 {{ block "branchSelector" . }}{{ end }} 53 <div class="flex items-center gap-3"> 54 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex md:hidden items-center text-sm gap-1 font-bold"> 55 {{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }} 56 </a> 57 <a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex md:hidden items-center text-sm gap-1 font-bold"> 58 {{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }} 59 </a> 60 <a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex md:hidden items-center text-sm gap-1 font-bold"> 61 {{ i "tags" "w-4" "h-4" }} {{ len .Tags }} 62 </a> 63 {{ template "repo/fragments/cloneDropdown" . }} 64 </div> 65 </div> 66 <div class="grid grid-cols-1 md:grid-cols-2 gap-2"> 67 {{ block "fileTree" . }}{{ end }} 68 {{ block "rightInfo" . }}{{ end }} 69 </div> 70 </main> 71{{ end }} 72 73{{ define "repoLanguages" }} 74 <details class="group -my-4 -m-6 mb-4"> 75 <summary class="flex gap-[1px] h-4 scale-y-50 hover:scale-y-100 origin-top group-open:scale-y-100 transition-all hover:cursor-pointer overflow-hidden rounded-t"> 76 {{ range $value := .Languages }} 77 <div 78 title='{{ or $value.Name "Other" }} {{ printf "%.1f" $value.Percentage }}%' 79 style="background-color: {{ $value.Color }}; width: {{ $value.Percentage }}%" 80 ></div> 81 {{ end }} 82 </summary> 83 <div class="px-4 py-2 border-b border-gray-200 dark:border-gray-600 flex items-center gap-4 flex-wrap"> 84 {{ range $value := .Languages }} 85 <div 86 class="flex items-center gap-2 text-xs align-items-center justify-center" 87 > 88 {{ template "repo/fragments/colorBall" (dict "color" (langColor $value.Name)) }} 89 <div>{{ or $value.Name "Other" }} 90 <span class="text-gray-500 dark:text-gray-400"> 91 {{ if lt $value.Percentage 0.05 }} 92 0.1% 93 {{ else }} 94 {{ printf "%.1f" $value.Percentage }}% 95 {{ end }} 96 </span></div> 97 </div> 98 {{ end }} 99 </div> 100 </details> 101{{ end }} 102 103{{ define "branchSelector" }} 104 <div class="flex gap-2 items-center justify-between w-full"> 105 <div class="flex gap-2 items-stretch"> 106 <select 107 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)" 108 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700" 109 > 110 <optgroup label="branches ({{len .Branches}})" class="bold text-sm"> 111 {{ range .Branches }} 112 <option 113 value="{{ .Reference.Name }}" 114 class="py-1" 115 {{ if eq .Reference.Name $.Ref }} 116 selected 117 {{ end }} 118 > 119 {{ .Reference.Name }} 120 </option> 121 {{ end }} 122 </optgroup> 123 <optgroup label="tags ({{len .Tags}})" class="bold text-sm"> 124 {{ range .Tags }} 125 <option 126 value="{{ .Reference.Name }}" 127 class="py-1" 128 {{ if eq .Reference.Name $.Ref }} 129 selected 130 {{ end }} 131 > 132 {{ .Reference.Name }} 133 </option> 134 {{ else }} 135 <option class="py-1" disabled>no tags found</option> 136 {{ end }} 137 </optgroup> 138 </select> 139 <div class="flex items-center gap-2"> 140 <a 141 href="/{{ .RepoInfo.FullName }}/compare?base={{ $.Ref | urlquery }}" 142 class="btn flex items-center gap-2 no-underline hover:no-underline" 143 title="Compare branches or tags" 144 > 145 {{ i "git-compare" "w-4 h-4" }} 146 </a> 147 </div> 148 </div> 149 </div> 150{{ end }} 151 152{{ define "fileTree" }} 153 <div id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700" > 154 {{ $linkstyle := "no-underline hover:underline dark:text-white" }} 155 156 {{ range .Files }} 157 <div class="grid grid-cols-3 gap-4 items-center py-1"> 158 <div class="col-span-2"> 159 {{ $link := printf "/%s/%s/%s/%s" $.RepoInfo.FullName "tree" (urlquery $.Ref) .Name }} 160 {{ $icon := "folder" }} 161 {{ $iconStyle := "size-4 fill-current" }} 162 163 {{ if .IsSubmodule }} 164 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }} 165 {{ $icon = "folder-input" }} 166 {{ $iconStyle = "size-4" }} 167 {{ end }} 168 169 {{ if .IsFile }} 170 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }} 171 {{ $icon = "file" }} 172 {{ $iconStyle = "size-4" }} 173 {{ end }} 174 175 <a href="{{ $link }}" class="{{ $linkstyle }}"> 176 <div class="flex items-center gap-2"> 177 {{ i $icon $iconStyle "flex-shrink-0" }} 178 <span class="truncate">{{ .Name }}</span> 179 </div> 180 </a> 181 </div> 182 183 <div class="text-sm col-span-1 text-right"> 184 {{ with .LastCommit }} 185 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash }}" class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .When }}</a> 186 {{ end }} 187 </div> 188 </div> 189 {{ end }} 190 </div> 191{{ end }} 192 193{{ define "rightInfo" }} 194 <div id="right-info" class="hidden md:block col-span-1"> 195 {{ block "commitLog" . }} {{ end }} 196 {{ block "branchList" . }} {{ end }} 197 {{ block "tagList" . }} {{ end }} 198 </div> 199{{ end }} 200 201{{ define "commitLog" }} 202<div id="commit-log" class="md:col-span-1 px-2 pb-4"> 203 <div class="flex justify-between items-center"> 204 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline"> 205 {{ i "logs" "w-4 h-4" }} commits 206 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ .TotalCommits }}</span> 207 </a> 208 </div> 209 <div class="flex flex-col gap-6"> 210 {{ range .CommitsTrunc }} 211 <div> 212 <div id="commit-message"> 213 {{ $messageParts := splitN .Message "\n\n" 2 }} 214 <div class="text-base cursor-pointer"> 215 <div> 216 <div> 217 <a 218 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 219 class="inline no-underline hover:underline dark:text-white" 220 >{{ index $messageParts 0 }}</a 221 > 222 {{ if gt (len $messageParts) 1 }} 223 224 <button 225 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600" 226 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 227 > 228 {{ i "ellipsis" "w-3 h-3" }} 229 </button> 230 {{ end }} 231 </div> 232 {{ if gt (len $messageParts) 1 }} 233 <p 234 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300" 235 > 236 {{ nl2br (index $messageParts 1) }} 237 </p> 238 {{ end }} 239 </div> 240 </div> 241 </div> 242 243 <!-- commit info bar --> 244 <div class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center flex-wrap"> 245 {{ $verified := $.VerifiedCommits.IsVerified .Hash.String }} 246 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }} 247 {{ if $verified }} 248 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }} 249 {{ end }} 250 <span class="font-mono"> 251 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 252 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2"> 253 {{ slice .Hash.String 0 8 }} 254 {{ if $verified }} 255 {{ i "shield-check" "w-3 h-3" }} 256 {{ end }} 257 </a> 258 </span> 259 <span 260 class="mx-1 before:content-['·'] before:select-none" 261 ></span> 262 {{ template "attribution" (list . $.EmailToDid) }} 263 <div class="inline-block px-1 select-none after:content-['·']"></div> 264 {{ template "repo/fragments/time" .Committer.When }} 265 266 <!-- tags/branches --> 267 {{ $tagsForCommit := index $.TagMap .Hash.String }} 268 {{ if gt (len $tagsForCommit) 0 }} 269 <div class="inline-block px-1 select-none after:content-['·']"></div> 270 {{ end }} 271 {{ range $tagsForCommit }} 272 <span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-[2px] inline-flex items-center"> 273 {{ . }} 274 </span> 275 {{ end }} 276 277 <!-- ci status --> 278 {{ $pipeline := index $.Pipelines .Hash.String }} 279 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }} 280 <div class="inline-block px-1 select-none after:content-['·']"></div> 281 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "RepoInfo" $.RepoInfo "Pipeline" $pipeline) }} 282 {{ end }} 283 </div> 284 </div> 285 {{ end }} 286 </div> 287</div> 288{{ end }} 289 290{{ define "attribution" }} 291 {{ $commit := index . 0 }} 292 {{ $map := index . 1 }} 293 <span class="flex items-center gap-1"> 294 {{ $author := index $map $commit.Author.Email }} 295 {{ $coauthors := $commit.CoAuthors }} 296 {{ $all := list }} 297 298 {{ if $author }} 299 {{ $all = append $all $author }} 300 {{ end }} 301 {{ range $coauthors }} 302 {{ $co := index $map .Email }} 303 {{ if $co }} 304 {{ $all = append $all $co }} 305 {{ end }} 306 {{ end }} 307 308 {{ if $author }} 309 {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} 310 {{ else }} 311 {{ placeholderAvatar "tiny" }} 312 {{ end }} 313 <a href="{{ if $author }}/{{ $author }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 314 class="no-underline hover:underline"> 315 {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }} 316 {{ if $coauthors }} +{{ length $coauthors }}{{ end }} 317 </a> 318 </span> 319{{ end }} 320 321{{ define "branchList" }} 322 {{ if gt (len .BranchesTrunc) 0 }} 323 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700"> 324 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline"> 325 {{ i "git-branch" "w-4 h-4" }} branches 326 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ len .Branches }}</span> 327 </a> 328 <div class="flex flex-col gap-1"> 329 {{ range .BranchesTrunc }} 330 <div class="text-base flex items-center justify-between overflow-hidden"> 331 <div class="flex items-center gap-2 min-w-0 flex-1"> 332 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}" 333 class="inline-block truncate no-underline hover:underline dark:text-white"> 334 {{ .Reference.Name }} 335 </a> 336 {{ if .Commit }} 337 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span> 338 <span class="whitespace-nowrap text-xs text-gray-500 dark:text-gray-400 shrink-0">{{ template "repo/fragments/time" .Commit.Committer.When }}</span> 339 {{ end }} 340 {{ if .IsDefault }} 341 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span> 342 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono shrink-0">default</span> 343 {{ end }} 344 </div> 345 {{ if ne $.Ref .Reference.Name }} 346 <a href="/{{ $.RepoInfo.FullName }}/compare/{{ $.Ref | urlquery }}...{{ .Reference.Name | urlquery }}" 347 class="text-xs flex gap-2 items-center shrink-0 ml-2" 348 title="Compare branches or tags"> 349 {{ i "git-compare" "w-3 h-3" }} compare 350 </a> 351 {{ end }} 352 </div> 353 {{ end }} 354 </div> 355 </div> 356 {{ end }} 357{{ end }} 358 359{{ define "tagList" }} 360 {{ if gt (len .TagsTrunc) 0 }} 361 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700"> 362 <div class="flex justify-between items-center"> 363 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline"> 364 {{ i "tags" "w-4 h-4" }} tags 365 <span class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">{{ len .Tags }}</span> 366 </a> 367 </div> 368 <div class="flex flex-col gap-1"> 369 {{ range $idx, $tag := .TagsTrunc }} 370 {{ with $tag }} 371 <div> 372 <div class="text-base flex items-center gap-2"> 373 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}" 374 class="inline no-underline hover:underline dark:text-white"> 375 {{ .Reference.Name }} 376 </a> 377 </div> 378 <div> 379 {{ with .Tag }} 380 <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Tagger.When }}</span> 381 {{ end }} 382 {{ if eq $idx 0 }} 383 {{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>{{ end }} 384 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span> 385 {{ end }} 386 </div> 387 </div> 388 {{ end }} 389 {{ end }} 390 </div> 391 </div> 392 {{ end }} 393{{ end }} 394 395{{ define "repoAfter" }} 396 {{- if or .HTMLReadme .Readme -}} 397 {{ template "repo/fragments/readme" . }} 398 {{- end -}} 399{{ end }}