~gitpocket/gitpocket

1
bfa87e353b0b3435f4243841ac16cb42f5c8d360
mainfeed-discovery
gitpocket/templates/blob.html -rw-r--r--1.2 KiB ViewLogBlameView rawPermalink 3e4df176f3 feat(basin): light theme, highlighting and latex 1 months ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{{define "content"}}
{{$p := .Data.Page}}
{{template "crumbs" .Data}}
<p class="muted">{{size .Data.Size}} · <a href="/{{$p.Repo.Path}}/raw/{{$p.Ref}}/{{.Data.Path}}">Raw</a>{{if .Data.Markdown}} · <a href="?source=1">Source</a>{{end}} · <a href="/{{$p.Repo.Path}}/log/{{$p.Ref}}?path={{.Data.Path}}">History</a></p>
{{if .Data.Binary}}<p class="muted">Binary file, see raw.</p>
{{else if .Data.Large}}<p class="muted">File too large to display, see raw.</p>
{{else if .Data.Markdown}}<article class="readme">{{.Data.Markdown}}</article>
{{else if .Data.Highlighted}}<div class="code">{{.Data.Highlighted}}</div>
{{else}}
<table class="blob">{{range $i, $l := lines .Data.Content}}<tr><td class="n" id="L{{inc $i}}"><a href="#L{{inc $i}}">{{inc $i}}</a></td><td class="l">{{$l}}</td></tr>{{end}}</table>
{{end}}
{{end}}
{{define "crumbs"}}
{{$p := .Page}}
<p class="crumbs"><a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/">{{$p.Repo.Name}}</a>{{range $i, $c := .Crumbs}}/<a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{join $.Crumbs (inc $i)}}{{if lt (inc $i) (len $.Crumbs)}}/{{end}}">{{$c}}</a>{{end}} <span class="muted">at <a href="/{{$p.Repo.Path}}/log/{{$p.Ref}}">{{$p.Ref}}</a></span></p>
{{end}}