bidet / internal / handlers / templates / repo.tmpl

@ b283f1af81a23d60c77f4f569d74cbb747059049 | 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>
<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>
{{- if ne .Readme "" -}}
<hr>
<h2>{{.ReadmeName}}</h2>
<pre>
{{.Readme}}
</pre>
{{- end -}}
{{end}}

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