this repo has no description
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }} 2 3{{ define "extrameta" }} 4 <meta 5 name="vcs:clone" 6 content="https://tangled.sh/{{ .RepoInfo.FullName }}" 7 /> 8 <meta 9 name="forge:summary" 10 content="https://tangled.sh/{{ .RepoInfo.FullName }}" 11 /> 12 <meta 13 name="forge:dir" 14 content="https://tangled.sh/{{ .RepoInfo.FullName }}/tree/{ref}/{path}" 15 /> 16 <meta 17 name="forge:file" 18 content="https://tangled.sh/{{ .RepoInfo.FullName }}/blob/{ref}/{path}" 19 /> 20 <meta 21 name="forge:line" 22 content="https://tangled.sh/{{ .RepoInfo.FullName }}/blob/{ref}/{path}#L{line}" 23 /> 24 <meta 25 name="go-import" 26 content="tangled.sh/{{ .RepoInfo.FullNameWithoutAt }} git https://tangled.sh/{{ .RepoInfo.FullName }}" 27 /> 28{{ end }} 29 30{{ define "repoContent" }} 31 <main> 32 {{ block "branchSelector" . }}{{ end }} 33 <div class="grid grid-cols-1 md:grid-cols-2 gap-2"> 34 {{ block "fileTree" . }}{{ end }} 35 {{ block "rightInfo" . }}{{ end }} 36 </div> 37 </main> 38{{ end }} 39 40{{ define "branchSelector" }} 41 <div class="flex justify-between pb-5"> 42 <select 43 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)" 44 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700" 45 > 46 <optgroup label="branches ({{len .Branches}})" class="bold text-sm"> 47 {{ range .Branches }} 48 <option 49 value="{{ .Reference.Name }}" 50 class="py-1" 51 {{ if eq .Reference.Name $.Ref }} 52 selected 53 {{ end }} 54 > 55 {{ .Reference.Name }} 56 </option> 57 {{ end }} 58 </optgroup> 59 <optgroup label="tags ({{len .Tags}})" class="bold text-sm"> 60 {{ range .Tags }} 61 <option 62 value="{{ .Reference.Name }}" 63 class="py-1" 64 {{ if eq .Reference.Name $.Ref }} 65 selected 66 {{ end }} 67 > 68 {{ .Reference.Name }} 69 </option> 70 {{ else }} 71 <option class="py-1" disabled>no tags found</option> 72 {{ end }} 73 </optgroup> 74 </select> 75 </div> 76{{ end }} 77 78{{ define "fileTree" }} 79 <div 80 id="file-tree" 81 class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700" 82 > 83 {{ $containerstyle := "py-1" }} 84 {{ $linkstyle := "no-underline hover:underline dark:text-white" }} 85 86 {{ range .Files }} 87 {{ if not .IsFile }} 88 <div class="{{ $containerstyle }}"> 89 <div class="flex justify-between items-center"> 90 <a 91 href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref | urlquery }}/{{ .Name }}" 92 class="{{ $linkstyle }}" 93 > 94 <div class="flex items-center gap-2"> 95 {{ i "folder" "w-3 h-3 fill-current" }} 96 {{ .Name }} 97 </div> 98 </a> 99 100 <time class="text-xs text-gray-500 dark:text-gray-400" 101 >{{ timeFmt .LastCommit.When }}</time 102 > 103 </div> 104 </div> 105 {{ end }} 106 {{ end }} 107 108 {{ range .Files }} 109 {{ if .IsFile }} 110 <div class="{{ $containerstyle }}"> 111 <div class="flex justify-between items-center"> 112 <a 113 href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref | urlquery }}/{{ .Name }}" 114 class="{{ $linkstyle }}" 115 > 116 <div class="flex items-center gap-2"> 117 {{ i "file" "w-3 h-3" }}{{ .Name }} 118 </div> 119 </a> 120 121 <time class="text-xs text-gray-500 dark:text-gray-400" 122 >{{ timeFmt .LastCommit.When }}</time 123 > 124 </div> 125 </div> 126 {{ end }} 127 {{ end }} 128 </div> 129{{ end }} 130 131{{ define "rightInfo" }} 132 <div id="right-info" class="col-span-1"> 133 {{ block "commitLog" . }} {{ end }} 134 {{ block "branchList" . }} {{ end }} 135 {{ block "tagList" . }} {{ end }} 136 </div> 137{{ end }} 138 139{{ define "commitLog" }} 140<div id="commit-log" class="md:col-span-1 px-2 pb-4"> 141 <div class="flex justify-between items-center"> 142 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group"> 143 <div class="flex gap-2 items-center"> 144 {{ i "git-commit-horizontal" "w-4 h-4" }} commits 145 </div> 146 {{ if lt (len .CommitsTrunc) .TotalCommits }} 147 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 148 view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }} 149 </span> 150 {{ end }} 151 </a> 152 </div> 153 <div class="flex flex-col gap-6"> 154 {{ range .CommitsTrunc }} 155 <div> 156 <div id="commit-message"> 157 {{ $messageParts := splitN .Message "\n\n" 2 }} 158 <div class="text-base cursor-pointer"> 159 <div> 160 <div> 161 <a 162 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 163 class="inline no-underline hover:underline dark:text-white" 164 >{{ index $messageParts 0 }}</a 165 > 166 {{ if gt (len $messageParts) 1 }} 167 168 <button 169 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600" 170 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 171 > 172 {{ i "ellipsis" "w-3 h-3" }} 173 </button> 174 {{ end }} 175 </div> 176 {{ if gt (len $messageParts) 1 }} 177 <p 178 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300" 179 > 180 {{ nl2br (index $messageParts 1) }} 181 </p> 182 {{ end }} 183 </div> 184 </div> 185 </div> 186 187 <div class="text-xs text-gray-500 dark:text-gray-400"> 188 <span class="font-mono"> 189 <a 190 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 191 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 192 >{{ slice .Hash.String 0 8 }}</a 193 ></span 194 > 195 <span 196 class="mx-2 before:content-['·'] before:select-none" 197 ></span> 198 <span> 199 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }} 200 <a 201 href="{{ if $didOrHandle }} 202 /{{ $didOrHandle }} 203 {{ else }} 204 mailto:{{ .Author.Email }} 205 {{ end }}" 206 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 207 >{{ if $didOrHandle }} 208 {{ $didOrHandle }} 209 {{ else }} 210 {{ .Author.Name }} 211 {{ end }}</a 212 > 213 </span> 214 <div 215 class="inline-block px-1 select-none after:content-['·']" 216 ></div> 217 <span>{{ timeFmt .Author.When }}</span> 218 {{ $tagsForCommit := index $.TagMap .Hash.String }} 219 {{ if gt (len $tagsForCommit) 0 }} 220 <div 221 class="inline-block px-1 select-none after:content-['·']" 222 ></div> 223 {{ end }} 224 {{ range $tagsForCommit }} 225 <span 226 class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center" 227 > 228 {{ . }} 229 </span> 230 {{ end }} 231 </div> 232 </div> 233 {{ end }} 234 </div> 235</div> 236{{ end }} 237 238{{ define "branchList" }} 239 {{ if gt (len .BranchesTrunc) 0 }} 240 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700"> 241 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group"> 242 <div class="flex gap-2 items-center"> 243 <!-- git-branch icon is seemingly bigger than others at 4x4 --> 244 {{ i "git-branch" "w-3 h-3" }} branches 245 </div> 246 {{ if lt (len .BranchesTrunc) (len .Branches) }} 247 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 248 view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }} 249 </span> 250 {{ end }} 251 </a> 252 <div class="flex flex-col gap-1"> 253 {{ range .BranchesTrunc }} 254 <div class="text-base flex items-center gap-2"> 255 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}" 256 class="inline no-underline hover:underline dark:text-white"> 257 {{ .Reference.Name }} 258 </a> 259 {{ if .Commit }} 260 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span> 261 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Commit.Author.When }}</time> 262 {{ end }} 263 {{ if .IsDefault }} 264 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span> 265 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">default</span> 266 {{ end }} 267 </div> 268 {{ end }} 269 </div> 270 </div> 271 {{ end }} 272{{ end }} 273 274{{ define "tagList" }} 275 {{ if gt (len .TagsTrunc) 0 }} 276 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700"> 277 <div class="flex justify-between items-center"> 278 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group"> 279 <div class="flex gap-2 items-center"> 280 {{ i "tags" "w-4 h-4" }} tags 281 </div> 282 {{ if lt (len .TagsTrunc) (len .Tags) }} 283 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 284 view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }} 285 </span> 286 {{ end }} 287 </a> 288 </div> 289 <div class="flex flex-col gap-1"> 290 {{ range $idx, $tag := .TagsTrunc }} 291 {{ with $tag }} 292 <div> 293 <div class="text-base flex items-center gap-2"> 294 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}" 295 class="inline no-underline hover:underline dark:text-white"> 296 {{ .Reference.Name }} 297 </a> 298 </div> 299 <div> 300 {{ with .Tag }} 301 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Tagger.When }}</time> 302 {{ end }} 303 {{ if eq $idx 0 }} 304 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span> 305 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span> 306 {{ end }} 307 </div> 308 </div> 309 {{ end }} 310 {{ end }} 311 </div> 312 </div> 313 {{ end }} 314{{ end }} 315 316{{ define "repoAfter" }} 317 {{- if .HTMLReadme }} 318 <section 319 class="p-6 mt-4 rounded-br rounded-bl bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto {{ if not .Raw }} 320 prose dark:prose-invert dark:[&_pre]:bg-gray-900 321 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900 322 dark:[&_pre]:border dark:[&_pre]:border-gray-700 323 {{ end }}" 324 > 325 <article class="{{ if .Raw }}whitespace-pre{{ end }}"> 326 {{ if .Raw }} 327 <pre 328 class="dark:bg-gray-900 dark:text-gray-200 dark:border dark:border-gray-700 dark:p-4 dark:rounded" 329 > 330{{ .HTMLReadme }}</pre 331 > 332 {{ else }} 333 {{ .HTMLReadme }} 334 {{ end }} 335 </article> 336 </section> 337 {{- end -}} 338 339 {{ template "repo/fragments/cloneInstructions" . }} 340{{ end }}