this repo has no description
at pr-actions 9.0 kB view raw
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }} 2 3{{ define "repoContent" }} 4 <main> 5 {{ block "branchSelector" . }} {{ end }} 6 <div class="grid grid-cols-1 md:grid-cols-2 gap-2"> 7 {{ block "fileTree" . }} {{ end }} 8 {{ block "commitLog" . }} {{ end }} 9 </div> 10 </main> 11{{ end }} 12 13{{ define "branchSelector" }} 14<div class="flex justify-between pb-5"> 15 <select 16 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)" 17 class="p-1 border border-gray-200 bg-white" 18 > 19 <optgroup label="branches" class="bold text-sm"> 20 {{ range .Branches }} 21 <option 22 value="{{ .Reference.Name }}" 23 class="py-1" 24 {{ if eq .Reference.Name $.Ref }} 25 selected 26 {{ end }} 27 > 28 {{ .Reference.Name }} 29 </option> 30 {{ end }} 31 </optgroup> 32 <optgroup label="tags" class="bold text-sm"> 33 {{ range .Tags }} 34 <option 35 value="{{ .Reference.Name }}" 36 class="py-1" 37 {{ if eq .Reference.Name $.Ref }} 38 selected 39 {{ end }} 40 > 41 {{ .Reference.Name }} 42 </option> 43 {{ else }} 44 <option class="py-1" disabled>no tags found</option> 45 {{ end }} 46 </optgroup> 47 </select> 48 <a 49 href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" 50 class="ml-2 no-underline flex items-center gap-2 text-sm uppercase font-bold" 51 > 52 {{ i "logs" "w-4 h-4" }} 53 {{ .TotalCommits }} 54 {{ if eq .TotalCommits 1 }}commit{{ else }}commits{{ end }} 55 </a> 56</div> 57{{ end }} 58 59{{ define "fileTree" }} 60<div id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200"> 61 {{ $containerstyle := "py-1" }} 62 {{ $linkstyle := "no-underline hover:underline" }} 63 64 {{ range .Files }} 65 {{ if not .IsFile }} 66 <div class="{{ $containerstyle }}"> 67 <div class="flex justify-between items-center"> 68 <a 69 href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref | urlquery }}/{{ .Name }}" 70 class="{{ $linkstyle }}" 71 > 72 <div class="flex items-center gap-2"> 73 {{ i "folder" "w-3 h-3 fill-current" }} 74 {{ .Name }} 75 </div> 76 </a> 77 78 <time class="text-xs text-gray-500" 79 >{{ timeFmt .LastCommit.When }}</time 80 > 81 </div> 82 </div> 83 {{ end }} 84 {{ end }} 85 86 {{ range .Files }} 87 {{ if .IsFile }} 88 <div class="{{ $containerstyle }}"> 89 <div class="flex justify-between items-center"> 90 <a 91 href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref | urlquery }}/{{ .Name }}" 92 class="{{ $linkstyle }}" 93 > 94 <div class="flex items-center gap-2"> 95 {{ i "file" "w-3 h-3" }}{{ .Name }} 96 </div> 97 </a> 98 99 <time class="text-xs text-gray-500" 100 >{{ timeFmt .LastCommit.When }}</time 101 > 102 </div> 103 </div> 104 {{ end }} 105 {{ end }} 106</div> 107{{ end }} 108 109 110{{ define "commitLog" }} 111<div id="commit-log" class="hidden md:block md:col-span-1"> 112 {{ range .Commits }} 113 <div class="relative px-2 pb-8"> 114 <div id="commit-message"> 115 {{ $messageParts := splitN .Message "\n\n" 2 }} 116 <div class="text-base cursor-pointer"> 117 <div> 118 <div> 119 <a 120 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 121 class="inline no-underline hover:underline" 122 >{{ index $messageParts 0 }}</a 123 > 124 {{ if gt (len $messageParts) 1 }} 125 126 <button 127 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded" 128 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 129 > 130 {{ i "ellipsis" "w-3 h-3" }} 131 </button> 132 {{ end }} 133 </div> 134 {{ if gt (len $messageParts) 1 }} 135 <p 136 class="hidden mt-1 text-sm cursor-text pb-2" 137 > 138 {{ nl2br (unwrapText (index $messageParts 1)) }} 139 </p> 140 {{ end }} 141 </div> 142 </div> 143 </div> 144 145 <div class="text-xs text-gray-500"> 146 <span class="font-mono"> 147 <a 148 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 149 class="text-gray-500 no-underline hover:underline" 150 >{{ slice .Hash.String 0 8 }}</a 151 > 152 </span> 153 <span 154 class="mx-2 before:content-['·'] before:select-none" 155 ></span> 156 <span> 157 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }} 158 <a 159 href="{{ if $didOrHandle }}/{{ $didOrHandle }}{{ else }}mailto:{{ .Author.Email }}{{ end }}" 160 class="text-gray-500 no-underline hover:underline" 161 >{{ if $didOrHandle }}{{ $didOrHandle }}{{ else }}{{ .Author.Name }}{{ end }}</a 162 > 163 </span> 164 <div 165 class="inline-block px-1 select-none after:content-['·']" 166 ></div> 167 <span>{{ timeFmt .Author.When }}</span> 168 {{ $tagsForCommit := index $.TagMap .Hash.String }} 169 {{ if gt (len $tagsForCommit) 0 }} 170 <div 171 class="inline-block px-1 select-none after:content-['·']" 172 ></div> 173 {{ end }} 174 {{ range $tagsForCommit }} 175 <span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center"> 176 {{ . }} 177 </span> 178 {{ end }} 179 </div> 180 </div> 181 {{ end }} 182</div> 183{{ end }} 184 185 186{{ define "repoAfter" }} 187 {{- if .HTMLReadme }} 188 <section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto {{ if not .Raw }} prose {{ end }}"> 189 <article class="{{ if .Raw }}whitespace-pre{{end}}"> 190 {{ if .Raw }} 191 <pre>{{ .HTMLReadme }}</pre> 192 {{ else }} 193 {{ .HTMLReadme }} 194 {{ end }} 195 </article> 196 </section> 197 {{- end -}} 198 199 200 <section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto flex flex-col gap-4"> 201 <div class="flex flex-col gap-2"> 202 <strong>push</strong> 203 <div class="md:pl-4 overflow-x-auto whitespace-nowrap"> 204 <code>git remote add origin git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code> 205 </div> 206 </div> 207 208 <div class="flex flex-col gap-2"> 209 <strong>clone</strong> 210 <div class="md:pl-4 flex flex-col gap-2"> 211 212 <div class="flex items-center gap-3"> 213 <span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">HTTP</span> 214 <div class="overflow-x-auto whitespace-nowrap flex-1"> 215 <code>git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}</code> 216 </div> 217 </div> 218 219 <div class="flex items-center gap-3"> 220 <span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">SSH</span> 221 <div class="overflow-x-auto whitespace-nowrap flex-1"> 222 <code>git clone git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code> 223 </div> 224 </div> 225 </div> 226 </div> 227 228 229 <p class="py-2 text-gray-500">Note that for self-hosted knots, clone URLs may be different based on your setup.</p> 230 </section> 231{{ end }}