showcase
- v0.2.4
- 37 commits
- 1 branch
- 6 tags
- updated
- CI 2/2
blob.html
1.5 KB · 31 lines
1{{define "content" -}}2{{template "repohead" .}}3{{template "crumbs" (dict "C" .Crumbs)}}4<section class="box">5 <div class="box-head file-head">6 {{ficon .Name "blob"}}<span class="file-name">{{.Name}}</span>7 <span class="file-stats">{{size .Size}}{{with .Lines}} · {{len .}} line{{if ne (len .) 1}}s{{end}}{{end}}</span>8 {{- with .Raw}}9 <span class="button-group">10 <a class="button button--small" id="file-raw" href="{{.}}">{{template "icon" "download"}}Raw</a>11 {{- if $.Copy}}<button class="button button--small button--copy" type="button" data-copy="file-raw" hidden title="Copy file">{{template "icon" "copy"}}{{template "icon" "check"}}<span class="sr-only">Copy file</span></button>{{end}}12 </span>13 {{- end}}14 </div>15 {{- if .Lines}}16 <pre class="code"><code>17 {{- range $i, $l := .Lines}}{{$n := inc $i}}<span class="line" id="L{{$n}}"><a class="ln" href="#L{{$n}}" aria-hidden="true">{{$n}}</a>{{$l}}</span>{{end -}}18 </code></pre>19 {{- else if and .Image .Raw}}20 <div class="box-note file-image"><img src="{{.Raw}}" alt="{{.Path}}"></div>21 {{- else if not .Raw}}22 <p class="box-note">This file is too large to show here. Clone the repository to get it.</p>23 {{- else if .Binary}}24 <p class="box-note">Binary file, not shown. Use the raw link to download it.</p>25 {{- else if .Large}}26 <p class="box-note">This file is too large to show here. Use the raw link to view it.</p>27 {{- else}}28 <p class="box-note">Empty file.</p>29 {{- end}}30</section>31{{- end}}