| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-repo-page"> |
| 3 | {{ template "repo-header" . }} |
| 4 | <section class="shithub-blob"> |
| 5 | <header class="shithub-code-head"> |
| 6 | <nav class="shithub-code-crumbs" aria-label="Breadcrumb"> |
| 7 | {{ range $i, $c := .Crumbs }} |
| 8 | {{ if $i }}<span class="shithub-code-sep">/</span>{{ end }} |
| 9 | <a href="{{ $c.URL }}">{{ $c.Name }}</a> |
| 10 | {{ end }} |
| 11 | </nav> |
| 12 | <div class="shithub-code-actions"> |
| 13 | <span class="shithub-blob-meta">{{ .Language }} · {{ .Size }} bytes</span> |
| 14 | {{ if and .CanWrite (not .IsLarge) (not .IsBinary) }} |
| 15 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/edit/{{ .Ref }}/{{ .Path }}" class="shithub-button shithub-button-icon" title="Edit this file" aria-label="Edit this file">{{ octicon "pencil" }}</a> |
| 16 | {{ end }} |
| 17 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/raw/{{ .Ref }}/{{ .Path }}" class="shithub-button">Raw</a> |
| 18 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/blob/{{ .Ref }}/{{ .Path }}#blame" class="shithub-button shithub-button-disabled" title="Coming in S18">Blame</a> |
| 19 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/commits/{{ .Ref }}/{{ .Path }}" class="shithub-button shithub-button-disabled" title="Coming in S18">History</a> |
| 20 | {{ if .CanWrite }} |
| 21 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/delete/{{ .Ref }}/{{ .Path }}" class="shithub-button shithub-button-icon" title="Delete this file" aria-label="Delete this file">{{ octicon "trash" }}</a> |
| 22 | {{ end }} |
| 23 | </div> |
| 24 | </header> |
| 25 | |
| 26 | {{ if .IsLarge }} |
| 27 | <div class="shithub-blob-too-large"> |
| 28 | This file is too large to display ({{ .Size }} bytes). |
| 29 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/raw/{{ .Ref }}/{{ .Path }}">Download raw</a>. |
| 30 | </div> |
| 31 | {{ else if .IsBinary }} |
| 32 | {{ if .IsImage }} |
| 33 | <div class="shithub-blob-image"> |
| 34 | <img src="/{{ .Owner }}/{{ .Repo.Name }}/raw/{{ .Ref }}/{{ .Path }}" alt="{{ .Path }}"> |
| 35 | </div> |
| 36 | {{ else }} |
| 37 | <div class="shithub-blob-binary"> |
| 38 | Binary file — {{ .Size }} bytes. |
| 39 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/raw/{{ .Ref }}/{{ .Path }}">Download raw</a>. |
| 40 | </div> |
| 41 | {{ end }} |
| 42 | {{ else if .IsMarkdown }} |
| 43 | <div class="shithub-blob-markdown">{{ .MarkdownHTML }}</div> |
| 44 | <details class="shithub-blob-source-toggle"> |
| 45 | <summary>View source</summary> |
| 46 | {{ template "blob-lines" . }} |
| 47 | </details> |
| 48 | {{ else }} |
| 49 | {{ template "blob-lines" . }} |
| 50 | {{ end }} |
| 51 | </section> |
| 52 | </section> |
| 53 | {{- end }} |