bidet / internal / handlers / templates / repo.tmpl

@ daa607db77c458c7a8501d4832981d3707004391 | history


{{define "title"}}{{.Repo}}/{{.Path}}{{end}}
{{define "content"}}
<h1><a href="/">{{.Hostname}}</a> / {{.Repo}}</h1>
<p>@ {{.Ref}}</p>
<p><a href="/{{.Repo}}/refs">refs</a>
 | <a href="/{{.Repo}}/commits/{{.Ref}}">commits</a></p>
<pre><code>git clone https://{{.Hostname}}/{{.Repo}}.git</code></pre>
<ul>
{{range .Entries}}
<li>
    {{- if .IsDir -}}
        📂 <a href="/{{$.Repo}}/tree/{{$.Ref}}/{{.Path}}">{{.Name}}</a>
    {{- else -}}
        📄 <a href="/{{$.Repo}}/blob/{{$.Ref}}/{{.Path}}">{{.Name}}</a>
    {{- end -}}
</li>
{{end}}
</ul>
<br>
{{- if ne .Readme "" -}}
<hr>
<h2>{{.ReadmeName}}</h2>
<pre>
{{.Readme}}
</pre>
{{- end -}}
{{end}}

{{define "repo"}}
{{template "base" .}}
{{end}}