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 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700" 45 > 46 <optgroup label="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" 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 <div id="commit-log" class="md:col-span-1"> 134 <h2 135 class="flex text-gray-500 dark:text-gray-400 items-center gap-2 pb-4 pl-2" 136 > 137 {{ i "logs" "w-4 h-4" }} 138 commits 139 </h2> 140 {{ range .CommitsTrunc }} 141 <div class="relative px-2 pb-8"> 142 <div id="commit-message"> 143 {{ $messageParts := splitN .Message "\n\n" 2 }} 144 <div class="text-base cursor-pointer"> 145 <div> 146 <div> 147 <a 148 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 149 class="inline no-underline hover:underline dark:text-white" 150 >{{ index $messageParts 0 }}</a 151 > 152 {{ if gt (len $messageParts) 1 }} 153 154 <button 155 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600" 156 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 157 > 158 {{ i "ellipsis" "w-3 h-3" }} 159 </button> 160 {{ end }} 161 </div> 162 {{ if gt (len $messageParts) 1 }} 163 <p 164 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300" 165 > 166 {{ nl2br (index $messageParts 1) }} 167 </p> 168 {{ end }} 169 </div> 170 </div> 171 </div> 172 173 <div class="text-xs text-gray-500 dark:text-gray-400"> 174 <span class="font-mono"> 175 <a 176 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 177 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 178 >{{ slice .Hash.String 0 8 }}</a 179 ></span 180 > 181 <span 182 class="mx-2 before:content-['·'] before:select-none" 183 ></span> 184 <span> 185 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }} 186 <a 187 href="{{ if $didOrHandle }} 188 /{{ $didOrHandle }} 189 {{ else }} 190 mailto:{{ .Author.Email }} 191 {{ end }}" 192 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 193 >{{ if $didOrHandle }} 194 {{ $didOrHandle }} 195 {{ else }} 196 {{ .Author.Name }} 197 {{ end }}</a 198 > 199 </span> 200 <div 201 class="inline-block px-1 select-none after:content-['·']" 202 ></div> 203 <span>{{ timeFmt .Author.When }}</span> 204 {{ $tagsForCommit := index $.TagMap .Hash.String }} 205 {{ if gt (len $tagsForCommit) 0 }} 206 <div 207 class="inline-block px-1 select-none after:content-['·']" 208 ></div> 209 {{ end }} 210 {{ range $tagsForCommit }} 211 <span 212 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" 213 > 214 {{ . }} 215 </span> 216 {{ end }} 217 </div> 218 </div> 219 {{ end }} 220 {{ $more := sub .TotalCommits (len .CommitsTrunc) }} 221 {{ if gt $more 0 }} 222 <div 223 class="flex text-gray-500 dark:text-gray-400 mb-2 gap-1 justify-end items-center" 224 > 225 <a 226 href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" 227 class="text-gray-500 dark:text-gray-400 text-sm" 228 > 229 &hellip; and {{ $more }} more 230 </a> 231 {{ i "arrow-right" "w-3 h-3" }} 232 </div> 233 {{ end }} 234 </div> 235 {{ if gt (len .Tags) 0 }} 236 <div 237 id="tags" 238 class="md:col-span-1 pt-4 border-t border-gray-200 dark:border-gray-700" 239 > 240 <h2 241 class="flex text-gray-500 dark:text-gray-400 items-center gap-2 pb-4 pl-2" 242 > 243 {{ i "tags" "w-4 h-4" }} 244 tags 245 </h2> 246 {{ range .Tags }} 247 <div class="relative px-2 pb-4"> 248 <div class="text-base"> 249 <div> 250 <a 251 href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}" 252 class="inline no-underline hover:underline dark:text-white" 253 >{{ .Reference.Name }}</a 254 > 255 {{ if gt (len .Message) 0 }} 256 {{ $messageParts := splitN .Message "\n\n" 2 }} 257 {{ $title := index $messageParts 0 }} 258 {{ $description := index $messageParts 1 }} 259 <span 260 class="text-sm text-gray-500 dark:text-gray-400 ml-2 truncate inline-block align-middle" 261 >{{ $title }}</span 262 > 263 {{ if gt (len $description) 1 }} 264 <button 265 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600" 266 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 267 > 268 {{ i "ellipsis" "w-3 h-3" }} 269 </button> 270 {{ end }} 271 {{ end }} 272 </div> 273 {{ if gt (len .Message) 0 }} 274 {{ $messageParts := splitN .Message "\n\n" 2 }} 275 {{ $description := index $messageParts 1 }} 276 {{ if gt (len $description) 1 }} 277 <div 278 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300" 279 > 280 {{ $description | markdown }} 281 </div> 282 {{ end }} 283 {{ end }} 284 <div 285 class="text-xs text-gray-500 dark:text-gray-400" 286 > 287 <span class="font-mono"> 288 <a 289 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Reference.Hash }}" 290 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 291 >{{ slice .Reference.Hash 0 8 }}</a 292 > 293 </span> 294 {{ with .Tag }} 295 <div 296 class="inline-block px-1 select-none after:content-['·']" 297 ></div> 298 <time>{{ timeFmt .Tagger.When }}</time> 299 {{ end }} 300 </div> 301 </div> 302 </div> 303 {{ end }} 304 </div> 305 {{ end }} 306 </div> 307{{ end }} 308 309{{ define "repoAfter" }} 310 {{- if .HTMLReadme }} 311 <div 312 class="mt-4 bg-white text-gray-600 dark:text-gray-400 313 px-6 py-3 prose dark:prose-invert 314 border-gray-200 dark:border-gray-700 315 text-sm border-b rounded-tl rounded-tr" 316 > 317 {{ .ReadmeFileName }} 318 </div> 319 <section 320 class="p-6 rounded-br rounded-bl bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto {{ if not .Raw }} 321 prose dark:prose-invert dark:[&_pre]:bg-gray-900 322 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900 323 dark:[&_pre]:border dark:[&_pre]:border-gray-700 324 {{ end }}" 325 > 326 <article class="{{ if .Raw }}whitespace-pre{{ end }}"> 327 {{ if .Raw }} 328 <pre 329 class="dark:bg-gray-900 dark:text-gray-200 dark:border dark:border-gray-700 dark:p-4 dark:rounded" 330 > 331{{ .HTMLReadme }}</pre 332 > 333 {{ else }} 334 {{ .HTMLReadme }} 335 {{ end }} 336 </article> 337 </section> 338 {{- end -}} 339 340 {{ template "repo/fragments/cloneInstructions" . }} 341{{ end }}